<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>NumCpp: Quaternion.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">NumCpp
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">A C++ implementation of the Python Numpy library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('_quaternion_8hpp_source.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Quaternion.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_quaternion_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_error_8hpp.html">NumCpp/Core/Error.hpp</a>&quot;</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_stl_algorithms_8hpp.html">NumCpp/Core/StlAlgorithms.hpp</a>&quot;</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_types_8hpp.html">NumCpp/Core/Types.hpp</a>&quot;</span></div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="hat_8hpp.html">NumCpp/Linalg/hat.hpp</a>&quot;</span></div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="argmax_8hpp.html">NumCpp/Functions/argmax.hpp</a>&quot;</span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="clip_8hpp.html">NumCpp/Functions/clip.hpp</a>&quot;</span></div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="dot_8hpp.html">NumCpp/Functions/dot.hpp</a>&quot;</span></div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="square_8hpp.html">NumCpp/Functions/square.hpp</a>&quot;</span></div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_nd_array_8hpp.html">NumCpp/NdArray.hpp</a>&quot;</span></div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="essentially_equal_8hpp.html">NumCpp/Utils/essentiallyEqual.hpp</a>&quot;</span></div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="num2str_8hpp.html">NumCpp/Utils/num2str.hpp</a>&quot;</span></div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="sqr_8hpp.html">NumCpp/Utils/sqr.hpp</a>&quot;</span></div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_vec3_8hpp.html">NumCpp/Vector/Vec3.hpp</a>&quot;</span></div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="preprocessor">#include &lt;array&gt;</span></div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="preprocessor">#include &lt;cmath&gt;</span></div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="preprocessor">#include &lt;iostream&gt;</span></div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacenc.html">nc</a></div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;{</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    <span class="keyword">namespace </span>rotations</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    {</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;        <span class="comment">//================================================================================</span></div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;        <span class="comment">// Class Description:</span></div><div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html">   57</a></span>&#160;<span class="comment"></span>        <span class="keyword">class </span><a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a></div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;        {</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;        <span class="keyword">private</span>:</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;            <span class="comment">//====================================Attributes==============================</span></div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;            std::array&lt;double, 4&gt; components_{ {0.0, 0.0, 0.0, 1.0} };</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;<span class="comment"></span>            <span class="keywordtype">void</span> normalize() noexcept</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;            {</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;                <span class="keywordtype">double</span> sumOfSquares = 0.0;</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;                <a class="code" href="namespacenc_1_1stl__algorithms.html#a734698435eabdbc5bdf93b195d7fb6a7">stl_algorithms::for_each</a>(components_.begin(), components_.end(),</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;                    [&amp;sumOfSquares](<span class="keywordtype">double</span> component) -&gt; <span class="keywordtype">void</span></div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;                    {</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;                        sumOfSquares += <a class="code" href="namespacenc_1_1utils.html#ae792e10a24b7e5b8291a6c31a28a4512">utils::sqr</a>(component);</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;                    });</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;                <span class="keyword">const</span> <span class="keywordtype">double</span> <a class="code" href="namespacenc.html#acd0cb71d7333dddc7cfa8a091768e94a">norm</a> = <a class="code" href="namespacenc.html#acb264011e6e6cd182cc47f67018a6b3c">std::sqrt</a>(sumOfSquares);</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;                <a class="code" href="namespacenc_1_1stl__algorithms.html#a734698435eabdbc5bdf93b195d7fb6a7">stl_algorithms::for_each</a>(components_.begin(), components_.end(),</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;                    [&amp;<a class="code" href="namespacenc.html#acd0cb71d7333dddc7cfa8a091768e94a">norm</a>](<span class="keywordtype">double</span>&amp; component) -&gt; <span class="keywordtype">void</span></div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;                    {</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;                        component /= <a class="code" href="namespacenc.html#acd0cb71d7333dddc7cfa8a091768e94a">norm</a>;</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;                    });</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;            }</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;<span class="comment"></span>            <span class="keywordtype">void</span> eulerToQuat(<span class="keywordtype">double</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a26f2a9303f0521ee36d92467ab45e3ab">roll</a>, <span class="keywordtype">double</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a601b444c8c8f820700844d7ab5f743ba">pitch</a>, <span class="keywordtype">double</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a5b5cef534a39badf5d3079ee642e675c">yaw</a>) noexcept</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;            {</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;                <span class="keyword">const</span> <span class="keywordtype">double</span> halfPhi = <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a26f2a9303f0521ee36d92467ab45e3ab">roll</a> / 2.0;</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;                <span class="keyword">const</span> <span class="keywordtype">double</span> halfTheta = <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a601b444c8c8f820700844d7ab5f743ba">pitch</a> / 2.0;</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;                <span class="keyword">const</span> <span class="keywordtype">double</span> halfPsi = <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a5b5cef534a39badf5d3079ee642e675c">yaw</a> / 2.0;</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;                components_[0] = <a class="code" href="namespacenc.html#a0d66dc207eb871bba26bff4838992fef">std::sin</a>(halfPhi) * <a class="code" href="namespacenc.html#affd0f5b31b2bd1b9cea9ab54e25dfab2">std::cos</a>(halfTheta) * <a class="code" href="namespacenc.html#affd0f5b31b2bd1b9cea9ab54e25dfab2">std::cos</a>(halfPsi);</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;                components_[0] -= <a class="code" href="namespacenc.html#affd0f5b31b2bd1b9cea9ab54e25dfab2">std::cos</a>(halfPhi) * <a class="code" href="namespacenc.html#a0d66dc207eb871bba26bff4838992fef">std::sin</a>(halfTheta) * <a class="code" href="namespacenc.html#a0d66dc207eb871bba26bff4838992fef">std::sin</a>(halfPsi);</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;                components_[1] = <a class="code" href="namespacenc.html#affd0f5b31b2bd1b9cea9ab54e25dfab2">std::cos</a>(halfPhi) * <a class="code" href="namespacenc.html#a0d66dc207eb871bba26bff4838992fef">std::sin</a>(halfTheta) * <a class="code" href="namespacenc.html#affd0f5b31b2bd1b9cea9ab54e25dfab2">std::cos</a>(halfPsi);</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;                components_[1] += <a class="code" href="namespacenc.html#a0d66dc207eb871bba26bff4838992fef">std::sin</a>(halfPhi) * <a class="code" href="namespacenc.html#affd0f5b31b2bd1b9cea9ab54e25dfab2">std::cos</a>(halfTheta) * <a class="code" href="namespacenc.html#a0d66dc207eb871bba26bff4838992fef">std::sin</a>(halfPsi);</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;                components_[2] = <a class="code" href="namespacenc.html#affd0f5b31b2bd1b9cea9ab54e25dfab2">std::cos</a>(halfPhi) * <a class="code" href="namespacenc.html#affd0f5b31b2bd1b9cea9ab54e25dfab2">std::cos</a>(halfTheta) * <a class="code" href="namespacenc.html#a0d66dc207eb871bba26bff4838992fef">std::sin</a>(halfPsi);</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;                components_[2] -= <a class="code" href="namespacenc.html#a0d66dc207eb871bba26bff4838992fef">std::sin</a>(halfPhi) * <a class="code" href="namespacenc.html#a0d66dc207eb871bba26bff4838992fef">std::sin</a>(halfTheta) * <a class="code" href="namespacenc.html#affd0f5b31b2bd1b9cea9ab54e25dfab2">std::cos</a>(halfPsi);</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;                components_[3] = <a class="code" href="namespacenc.html#affd0f5b31b2bd1b9cea9ab54e25dfab2">std::cos</a>(halfPhi) * <a class="code" href="namespacenc.html#affd0f5b31b2bd1b9cea9ab54e25dfab2">std::cos</a>(halfTheta) * <a class="code" href="namespacenc.html#affd0f5b31b2bd1b9cea9ab54e25dfab2">std::cos</a>(halfPsi);</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;                components_[3] += <a class="code" href="namespacenc.html#a0d66dc207eb871bba26bff4838992fef">std::sin</a>(halfPhi) * <a class="code" href="namespacenc.html#a0d66dc207eb871bba26bff4838992fef">std::sin</a>(halfTheta) * <a class="code" href="namespacenc.html#a0d66dc207eb871bba26bff4838992fef">std::sin</a>(halfPsi);</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;            }</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;<span class="comment"></span>            <span class="keywordtype">void</span> dcmToQuat(<span class="keyword">const</span> <a class="code" href="classnc_1_1_nd_array.html">NdArray&lt;double&gt;</a>&amp; dcm)</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;            {</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;                <span class="keyword">const</span> <a class="code" href="classnc_1_1_shape.html">Shape</a> inShape = dcm.<a class="code" href="classnc_1_1_nd_array.html#a232a5e8c426b629dcda9f9d52e8ce905">shape</a>();</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;                <span class="keywordflow">if</span> (!(inShape.<a class="code" href="classnc_1_1_shape.html#a6f89f699dea6eb89eef19e00c92b223a">rows</a> == 3 &amp;&amp; inShape.<a class="code" href="classnc_1_1_shape.html#aae1a3c997648aacaefb60d0e6d0bf10d">cols</a> == 3))</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;                {</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;                    <a class="code" href="_error_8hpp.html#af2aff1172060367b9c5398fa097fa8fd">THROW_INVALID_ARGUMENT_ERROR</a>(<span class="stringliteral">&quot;input direction cosine matrix must have shape = (3,3).&quot;</span>);</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;                }</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;                <a class="code" href="classnc_1_1_nd_array.html">NdArray&lt;double&gt;</a> checks(1, 4);</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;                checks[0] = 1 + dcm(0, 0) + dcm(1, 1) + dcm(2, 2);</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;                checks[1] = 1 + dcm(0, 0) - dcm(1, 1) - dcm(2, 2);</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;                checks[2] = 1 - dcm(0, 0) + dcm(1, 1) - dcm(2, 2);</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;                checks[3] = 1 - dcm(0, 0) - dcm(1, 1) + dcm(2, 2);</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;                <span class="keyword">const</span> <a class="code" href="namespacenc.html#aacba4d66f94f6f53637e23c5d82e20d8">uint32</a> maxIdx = <a class="code" href="namespacenc.html#a2185848c4b822d5636fad30c3eda6275">argmax</a>(checks).item();</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;                <span class="keywordflow">switch</span> (maxIdx)</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;                {</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;                    <span class="keywordflow">case</span> 0:</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;                    {</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;                        components_[3] = 0.5 * <a class="code" href="namespacenc.html#acb264011e6e6cd182cc47f67018a6b3c">std::sqrt</a>(1 + dcm(0, 0) + dcm(1, 1) + dcm(2, 2));</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;                        components_[0] = (dcm(2, 1) - dcm(1, 2)) / (4 * components_[3]);</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;                        components_[1] = (dcm(0, 2) - dcm(2, 0)) / (4 * components_[3]);</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;                        components_[2] = (dcm(1, 0) - dcm(0, 1)) / (4 * components_[3]);</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;                        <span class="keywordflow">break</span>;</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;                    }</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;                    <span class="keywordflow">case</span> 1:</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;                    {</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;                        components_[0] = 0.5 * <a class="code" href="namespacenc.html#acb264011e6e6cd182cc47f67018a6b3c">std::sqrt</a>(1 + dcm(0, 0) - dcm(1, 1) - dcm(2, 2));</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;                        components_[1] = (dcm(1, 0) + dcm(0, 1)) / (4 * components_[0]);</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;                        components_[2] = (dcm(2, 0) + dcm(0, 2)) / (4 * components_[0]);</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;                        components_[3] = (dcm(2, 1) - dcm(1, 2)) / (4 * components_[0]);</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;                        <span class="keywordflow">break</span>;</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;                    }</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;                    <span class="keywordflow">case</span> 2:</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;                    {</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;                        components_[1] = 0.5 * <a class="code" href="namespacenc.html#acb264011e6e6cd182cc47f67018a6b3c">std::sqrt</a>(1 - dcm(0, 0) + dcm(1, 1) - dcm(2, 2));</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;                        components_[0] = (dcm(1, 0) + dcm(0, 1)) / (4 * components_[1]);</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;                        components_[2] = (dcm(2, 1) + dcm(1, 2)) / (4 * components_[1]);</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;                        components_[3] = (dcm(0, 2) - dcm(2, 0)) / (4 * components_[1]);</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;                        <span class="keywordflow">break</span>;</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;                    }</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;                    <span class="keywordflow">case</span> 3:</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;                    {</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;                        components_[2] = 0.5 * <a class="code" href="namespacenc.html#acb264011e6e6cd182cc47f67018a6b3c">std::sqrt</a>(1 - dcm(0, 0) - dcm(1, 1) + dcm(2, 2));</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;                        components_[0] = (dcm(2, 0) + dcm(0, 2)) / (4 * components_[2]);</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;                        components_[1] = (dcm(2, 1) + dcm(1, 2)) / (4 * components_[2]);</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;                        components_[3] = (dcm(1, 0) - dcm(0, 1)) / (4 * components_[2]);</div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;                        <span class="keywordflow">break</span>;</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;                    }</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;                }</div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;            }</div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;</div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;        <span class="keyword">public</span>:</div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;<span class="comment"></span>            <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#ae4b67d060aa58aa6d22813d6ab851ec8">Quaternion</a>() noexcept = <span class="keywordflow">default</span>;</div><div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;</div><div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00189"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#a8c498c295071b8b787902044bf87d34d">  189</a></span>&#160;<span class="comment"></span>            <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a8c498c295071b8b787902044bf87d34d">Quaternion</a>(<span class="keywordtype">double</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a26f2a9303f0521ee36d92467ab45e3ab">roll</a>, <span class="keywordtype">double</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a601b444c8c8f820700844d7ab5f743ba">pitch</a>, <span class="keywordtype">double</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a5b5cef534a39badf5d3079ee642e675c">yaw</a>) noexcept</div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;            {</div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;                eulerToQuat(<a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a26f2a9303f0521ee36d92467ab45e3ab">roll</a>, <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a601b444c8c8f820700844d7ab5f743ba">pitch</a>, <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a5b5cef534a39badf5d3079ee642e675c">yaw</a>);</div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;            }</div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;</div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00203"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#a3ba2fb2c68554ec78a0957dc1fd7752d">  203</a></span>&#160;<span class="comment"></span>            <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a3ba2fb2c68554ec78a0957dc1fd7752d">Quaternion</a>(<span class="keywordtype">double</span> inI, <span class="keywordtype">double</span> inJ, <span class="keywordtype">double</span> inK, <span class="keywordtype">double</span> inS) noexcept :</div><div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;                components_{ inI, inJ, inK, inS }</div><div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;            {</div><div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;                normalize();</div><div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;            }</div><div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;</div><div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00217"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#addcc7fb7b4acd4201e7f5b90ef207f4d">  217</a></span>&#160;<span class="comment"></span>            <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#addcc7fb7b4acd4201e7f5b90ef207f4d">Quaternion</a>(<span class="keyword">const</span> <a class="code" href="classnc_1_1_nd_array.html">NdArray&lt;double&gt;</a>&amp; inArray) :</div><div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;                components_{ 0.0, 0.0, 0.0, 0.0 }</div><div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;            {</div><div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;                <span class="keywordflow">if</span> (inArray.size() == 3)</div><div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;                {</div><div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;                    <span class="comment">// euler angles</span></div><div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;                    eulerToQuat(inArray[0], inArray[1], inArray[2]);</div><div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;                }</div><div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;                <span class="keywordflow">else</span> <span class="keywordflow">if</span> (inArray.size() == 4)</div><div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;                {</div><div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;                    <span class="comment">// quaternion i, j, k, s components</span></div><div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;                    <a class="code" href="namespacenc_1_1stl__algorithms.html#afc0a193758bfb62333c4ed53ada9537d">stl_algorithms::copy</a>(inArray.cbegin(), inArray.cend(), components_.begin());</div><div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;                    normalize();</div><div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;                }</div><div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;                <span class="keywordflow">else</span> <span class="keywordflow">if</span> (inArray.size() == 9)</div><div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;                {</div><div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;                    <span class="comment">// direction cosine matrix</span></div><div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;                    dcmToQuat(inArray);</div><div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;                }</div><div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;                <span class="keywordflow">else</span></div><div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;                {</div><div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;                    <a class="code" href="_error_8hpp.html#af2aff1172060367b9c5398fa097fa8fd">THROW_INVALID_ARGUMENT_ERROR</a>(<span class="stringliteral">&quot;input array is not a valid size.&quot;</span>);</div><div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;                }</div><div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;            }</div><div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;</div><div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00249"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#abbacae2cb36d4f7e93e1cf130f8ca6b4">  249</a></span>&#160;<span class="comment"></span>            <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#abbacae2cb36d4f7e93e1cf130f8ca6b4">Quaternion</a>(<span class="keyword">const</span> <a class="code" href="classnc_1_1_vec3.html">Vec3</a>&amp; inAxis, <span class="keywordtype">double</span> inAngle) noexcept</div><div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;            {</div><div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;                <span class="comment">// normalize the input vector</span></div><div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;                <a class="code" href="classnc_1_1_vec3.html">Vec3</a> normAxis = inAxis.<a class="code" href="classnc_1_1_vec3.html#a6356b462b11a156b923a7c79b9747c25">normalize</a>();</div><div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;</div><div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;                <span class="keyword">const</span> <span class="keywordtype">double</span> halfAngle = inAngle / 2.0;</div><div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;                <span class="keyword">const</span> <span class="keywordtype">double</span> sinHalfAngle = <a class="code" href="namespacenc.html#a0d66dc207eb871bba26bff4838992fef">std::sin</a>(halfAngle);</div><div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;</div><div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;                components_[0] = normAxis.<a class="code" href="classnc_1_1_vec3.html#a7f71dd08d58a1327739de6041e3362bb">x</a> * sinHalfAngle;</div><div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;                components_[1] = normAxis.<a class="code" href="classnc_1_1_vec3.html#a969dd1c195f4c78fc3a93292391e29c1">y</a> * sinHalfAngle;</div><div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;                components_[2] = normAxis.<a class="code" href="classnc_1_1_vec3.html#a0896ee691f46ce0bd669b869fe6acb41">z</a> * sinHalfAngle;</div><div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;                components_[3] = <a class="code" href="namespacenc.html#affd0f5b31b2bd1b9cea9ab54e25dfab2">std::cos</a>(halfAngle);</div><div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;            }</div><div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;</div><div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00270"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#a81b7db9d5e593a61272e09ce7dcc1325">  270</a></span>&#160;<span class="comment"></span>            <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a81b7db9d5e593a61272e09ce7dcc1325">Quaternion</a>(<span class="keyword">const</span> <a class="code" href="classnc_1_1_nd_array.html">NdArray&lt;double&gt;</a>&amp; inAxis, <span class="keywordtype">double</span> inAngle) :</div><div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;                <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a>(<a class="code" href="classnc_1_1_vec3.html">Vec3</a>(inAxis), inAngle)</div><div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;            {}</div><div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;</div><div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00285"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#ab7905c39ef162eb7667abcd3131430ea">  285</a></span>&#160;<span class="comment"></span>            <span class="keyword">static</span> <a class="code" href="classnc_1_1_nd_array.html">NdArray&lt;double&gt;</a> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#ab7905c39ef162eb7667abcd3131430ea">angularVelocity</a>(<span class="keyword">const</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a>&amp; inQuat1, <span class="keyword">const</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a>&amp; inQuat2, <span class="keywordtype">double</span> inTime) noexcept</div><div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;            {</div><div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;                <a class="code" href="classnc_1_1_nd_array.html">NdArray&lt;double&gt;</a> q0 = inQuat1.toNdArray();</div><div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;                <a class="code" href="classnc_1_1_nd_array.html">NdArray&lt;double&gt;</a> q1 = inQuat2.toNdArray();</div><div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;</div><div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;                <a class="code" href="classnc_1_1_nd_array.html">NdArray&lt;double&gt;</a> qDot = q1 - q0;</div><div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;                qDot /= inTime;</div><div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;</div><div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;                <a class="code" href="classnc_1_1_nd_array.html">NdArray&lt;double&gt;</a> eyeTimesScalar(3);</div><div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;                eyeTimesScalar.<a class="code" href="classnc_1_1_nd_array.html#ad482cf57eed985a1bf8e3dcc0a0d21e1">zeros</a>();</div><div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;                eyeTimesScalar(0, 0) = inQuat2.s();</div><div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;                eyeTimesScalar(1, 1) = inQuat2.s();</div><div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;                eyeTimesScalar(2, 2) = inQuat2.s();</div><div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;</div><div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;                <a class="code" href="classnc_1_1_nd_array.html">NdArray&lt;double&gt;</a> epsilonHat = linalg::hat&lt;double&gt;(inQuat2.i(), inQuat2.j(), inQuat2.k());</div><div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;                <a class="code" href="classnc_1_1_nd_array.html">NdArray&lt;double&gt;</a> q(4, 3);</div><div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;                q.put(<a class="code" href="classnc_1_1_slice.html">Slice</a>(0, 3), <a class="code" href="classnc_1_1_slice.html">Slice</a>(0, 3), eyeTimesScalar + epsilonHat);</div><div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;                q(3, 0) = -inQuat2.i();</div><div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;                q(3, 1) = -inQuat2.j();</div><div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;                q(3, 2) = -inQuat2.k();</div><div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;</div><div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;                <a class="code" href="classnc_1_1_nd_array.html">NdArray&lt;double&gt;</a> omega = q.<a class="code" href="classnc_1_1_nd_array.html#aae29c9fbae3e92ce432703ffd7722d8b">transpose</a>().<a class="code" href="classnc_1_1_nd_array.html#a13e5756a193d375c0b52e5929a41ca2f">dot</a>(qDot.<a class="code" href="classnc_1_1_nd_array.html#aae29c9fbae3e92ce432703ffd7722d8b">transpose</a>());</div><div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;                <span class="keywordflow">return</span> omega *= 2;</div><div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;            }</div><div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;</div><div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00320"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#a1ed072758066ed454d9ba0452dc5a2d0">  320</a></span>&#160;<span class="comment"></span>            <a class="code" href="classnc_1_1_nd_array.html">NdArray&lt;double&gt;</a> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a1ed072758066ed454d9ba0452dc5a2d0">angularVelocity</a>(<span class="keyword">const</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a>&amp; inQuat2, <span class="keywordtype">double</span> inTime) <span class="keyword">const</span> noexcept</div><div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;            {</div><div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;                <span class="keywordflow">return</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#ab7905c39ef162eb7667abcd3131430ea">angularVelocity</a>(*<span class="keyword">this</span>, inQuat2, inTime);</div><div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;            }</div><div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;</div><div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00332"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#ade406544e8360506bb77102d17b14e61">  332</a></span>&#160;<span class="comment"></span>            <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#ade406544e8360506bb77102d17b14e61">conjugate</a>() const noexcept</div><div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;            {</div><div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;                <span class="keywordflow">return</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#ae4b67d060aa58aa6d22813d6ab851ec8">Quaternion</a>(-<a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a5a661b367dff916e8bdb5e28ac608ecd">i</a>(), -<a class="code" href="classnc_1_1rotations_1_1_quaternion.html#acb62c703a1f96333bf76ad0735cb8b97">j</a>(), -<a class="code" href="classnc_1_1rotations_1_1_quaternion.html#aa2eee61d3a428a558f28d1bb6cc6a048">k</a>(), <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a075b6f1befef247f5d638c91e1a451fd">s</a>());</div><div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;            }</div><div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;</div><div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00344"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#a5a661b367dff916e8bdb5e28ac608ecd">  344</a></span>&#160;<span class="comment"></span>            <span class="keywordtype">double</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a5a661b367dff916e8bdb5e28ac608ecd">i</a>() const noexcept</div><div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;            {</div><div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;                <span class="keywordflow">return</span> components_[0];</div><div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;            }</div><div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160;</div><div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00356"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#ae093d333b66b63eeef5704be4a374af2">  356</a></span>&#160;<span class="comment"></span>            <span class="keyword">static</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#ae093d333b66b63eeef5704be4a374af2">identity</a>() noexcept</div><div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;            {</div><div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160;                <span class="keywordflow">return</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#ae4b67d060aa58aa6d22813d6ab851ec8">Quaternion</a>();</div><div class="line"><a name="l00359"></a><span class="lineno">  359</span>&#160;            }</div><div class="line"><a name="l00360"></a><span class="lineno">  360</span>&#160;</div><div class="line"><a name="l00361"></a><span class="lineno">  361</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00362"></a><span class="lineno">  362</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00368"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#a9b0634474b2ff27f9443ba256ea00ab1">  368</a></span>&#160;<span class="comment"></span>            <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a9b0634474b2ff27f9443ba256ea00ab1">inverse</a>() const noexcept</div><div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;            {</div><div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;                <span class="keywordflow">return</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#ade406544e8360506bb77102d17b14e61">conjugate</a>();</div><div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;            }</div><div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160;</div><div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00381"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#acb62c703a1f96333bf76ad0735cb8b97">  381</a></span>&#160;<span class="comment"></span>            <span class="keywordtype">double</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#acb62c703a1f96333bf76ad0735cb8b97">j</a>() const noexcept</div><div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160;            {</div><div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;                <span class="keywordflow">return</span> components_[1];</div><div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;            }</div><div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160;</div><div class="line"><a name="l00386"></a><span class="lineno">  386</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00393"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#aa2eee61d3a428a558f28d1bb6cc6a048">  393</a></span>&#160;<span class="comment"></span>            <span class="keywordtype">double</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#aa2eee61d3a428a558f28d1bb6cc6a048">k</a>() const noexcept</div><div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160;            {</div><div class="line"><a name="l00395"></a><span class="lineno">  395</span>&#160;                <span class="keywordflow">return</span> components_[2];</div><div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160;            }</div><div class="line"><a name="l00397"></a><span class="lineno">  397</span>&#160;</div><div class="line"><a name="l00398"></a><span class="lineno">  398</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00399"></a><span class="lineno">  399</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00408"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#a314478702a3da52f2be3f422057d8732">  408</a></span>&#160;<span class="comment"></span>            <span class="keyword">static</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a314478702a3da52f2be3f422057d8732">nlerp</a>(<span class="keyword">const</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a>&amp; inQuat1, <span class="keyword">const</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a>&amp; inQuat2, <span class="keywordtype">double</span> inPercent)</div><div class="line"><a name="l00409"></a><span class="lineno">  409</span>&#160;            {</div><div class="line"><a name="l00410"></a><span class="lineno">  410</span>&#160;                <span class="keywordflow">if</span> (inPercent &lt; 0.0 || inPercent &gt; 1.0)</div><div class="line"><a name="l00411"></a><span class="lineno">  411</span>&#160;                {</div><div class="line"><a name="l00412"></a><span class="lineno">  412</span>&#160;                    <a class="code" href="_error_8hpp.html#af2aff1172060367b9c5398fa097fa8fd">THROW_INVALID_ARGUMENT_ERROR</a>(<span class="stringliteral">&quot;input percent must be of the range [0,1].&quot;</span>);</div><div class="line"><a name="l00413"></a><span class="lineno">  413</span>&#160;                }</div><div class="line"><a name="l00414"></a><span class="lineno">  414</span>&#160;</div><div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;                <span class="keywordflow">if</span> (<a class="code" href="namespacenc_1_1utils.html#aa55788420fda79bd8a06debbaa29d24c">utils::essentiallyEqual</a>(inPercent, 0.0))</div><div class="line"><a name="l00416"></a><span class="lineno">  416</span>&#160;                {</div><div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;                    <span class="keywordflow">return</span> inQuat1;</div><div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160;                }</div><div class="line"><a name="l00419"></a><span class="lineno">  419</span>&#160;                <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="namespacenc_1_1utils.html#aa55788420fda79bd8a06debbaa29d24c">utils::essentiallyEqual</a>(inPercent, 1.0))</div><div class="line"><a name="l00420"></a><span class="lineno">  420</span>&#160;                {</div><div class="line"><a name="l00421"></a><span class="lineno">  421</span>&#160;                    <span class="keywordflow">return</span> inQuat2;</div><div class="line"><a name="l00422"></a><span class="lineno">  422</span>&#160;                }</div><div class="line"><a name="l00423"></a><span class="lineno">  423</span>&#160;</div><div class="line"><a name="l00424"></a><span class="lineno">  424</span>&#160;                <span class="keyword">const</span> <span class="keywordtype">double</span> oneMinus = 1.0 - inPercent;</div><div class="line"><a name="l00425"></a><span class="lineno">  425</span>&#160;                std::array&lt;double, 4&gt; newComponents;</div><div class="line"><a name="l00426"></a><span class="lineno">  426</span>&#160;</div><div class="line"><a name="l00427"></a><span class="lineno">  427</span>&#160;                <a class="code" href="namespacenc_1_1stl__algorithms.html#a616d5dabd547326285946d0014361ab4">stl_algorithms::transform</a>(inQuat1.components_.begin(), inQuat1.components_.end(),</div><div class="line"><a name="l00428"></a><span class="lineno">  428</span>&#160;                    inQuat2.components_.begin(), newComponents.begin(),</div><div class="line"><a name="l00429"></a><span class="lineno">  429</span>&#160;                    [inPercent, oneMinus](<span class="keywordtype">double</span> component1, <span class="keywordtype">double</span> component2)</div><div class="line"><a name="l00430"></a><span class="lineno">  430</span>&#160;                    {</div><div class="line"><a name="l00431"></a><span class="lineno">  431</span>&#160;                        <span class="keywordflow">return</span> oneMinus * component1 + inPercent * component2;</div><div class="line"><a name="l00432"></a><span class="lineno">  432</span>&#160;                    });</div><div class="line"><a name="l00433"></a><span class="lineno">  433</span>&#160;</div><div class="line"><a name="l00434"></a><span class="lineno">  434</span>&#160;                <span class="keywordflow">return</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#ae4b67d060aa58aa6d22813d6ab851ec8">Quaternion</a>(newComponents[0], newComponents[1], newComponents[2], newComponents[3]);</div><div class="line"><a name="l00435"></a><span class="lineno">  435</span>&#160;            }</div><div class="line"><a name="l00436"></a><span class="lineno">  436</span>&#160;</div><div class="line"><a name="l00437"></a><span class="lineno">  437</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00438"></a><span class="lineno">  438</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00446"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#ab055510c1338490b957de867cecaf790">  446</a></span>&#160;<span class="comment"></span>            <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#ab055510c1338490b957de867cecaf790">nlerp</a>(<span class="keyword">const</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a>&amp; inQuat2, <span class="keywordtype">double</span> inPercent)<span class="keyword"> const</span></div><div class="line"><a name="l00447"></a><span class="lineno">  447</span>&#160;<span class="keyword">            </span>{</div><div class="line"><a name="l00448"></a><span class="lineno">  448</span>&#160;                <span class="keywordflow">return</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a314478702a3da52f2be3f422057d8732">nlerp</a>(*<span class="keyword">this</span>, inQuat2, inPercent);</div><div class="line"><a name="l00449"></a><span class="lineno">  449</span>&#160;            }</div><div class="line"><a name="l00450"></a><span class="lineno">  450</span>&#160;</div><div class="line"><a name="l00451"></a><span class="lineno">  451</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00452"></a><span class="lineno">  452</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00457"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#a601b444c8c8f820700844d7ab5f743ba">  457</a></span>&#160;<span class="comment"></span>            <span class="keywordtype">double</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a601b444c8c8f820700844d7ab5f743ba">pitch</a>() const noexcept</div><div class="line"><a name="l00458"></a><span class="lineno">  458</span>&#160;            {</div><div class="line"><a name="l00459"></a><span class="lineno">  459</span>&#160;                <span class="keywordflow">return</span> std::asin(2 * (<a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a075b6f1befef247f5d638c91e1a451fd">s</a>() * <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#acb62c703a1f96333bf76ad0735cb8b97">j</a>() - <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#aa2eee61d3a428a558f28d1bb6cc6a048">k</a>() * <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a5a661b367dff916e8bdb5e28ac608ecd">i</a>()));</div><div class="line"><a name="l00460"></a><span class="lineno">  460</span>&#160;            }</div><div class="line"><a name="l00461"></a><span class="lineno">  461</span>&#160;</div><div class="line"><a name="l00462"></a><span class="lineno">  462</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00463"></a><span class="lineno">  463</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00466"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#a44994f000aba8de9f11a169a62782ebd">  466</a></span>&#160;<span class="comment"></span>            <span class="keywordtype">void</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a44994f000aba8de9f11a169a62782ebd">print</a>() const noexcept</div><div class="line"><a name="l00467"></a><span class="lineno">  467</span>&#160;            {</div><div class="line"><a name="l00468"></a><span class="lineno">  468</span>&#160;                std::cout &lt;&lt; *<span class="keyword">this</span>;</div><div class="line"><a name="l00469"></a><span class="lineno">  469</span>&#160;            }</div><div class="line"><a name="l00470"></a><span class="lineno">  470</span>&#160;</div><div class="line"><a name="l00471"></a><span class="lineno">  471</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00472"></a><span class="lineno">  472</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00477"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#a26f2a9303f0521ee36d92467ab45e3ab">  477</a></span>&#160;<span class="comment"></span>            <span class="keywordtype">double</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a26f2a9303f0521ee36d92467ab45e3ab">roll</a>() const noexcept</div><div class="line"><a name="l00478"></a><span class="lineno">  478</span>&#160;            {</div><div class="line"><a name="l00479"></a><span class="lineno">  479</span>&#160;                <span class="keywordflow">return</span> std::atan2(2 * (<a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a075b6f1befef247f5d638c91e1a451fd">s</a>() * <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a5a661b367dff916e8bdb5e28ac608ecd">i</a>() + <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#acb62c703a1f96333bf76ad0735cb8b97">j</a>() * <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#aa2eee61d3a428a558f28d1bb6cc6a048">k</a>()), </div><div class="line"><a name="l00480"></a><span class="lineno">  480</span>&#160;                    1 - 2 * (<a class="code" href="namespacenc_1_1utils.html#ae792e10a24b7e5b8291a6c31a28a4512">utils::sqr</a>(<a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a5a661b367dff916e8bdb5e28ac608ecd">i</a>()) + <a class="code" href="namespacenc_1_1utils.html#ae792e10a24b7e5b8291a6c31a28a4512">utils::sqr</a>(<a class="code" href="classnc_1_1rotations_1_1_quaternion.html#acb62c703a1f96333bf76ad0735cb8b97">j</a>())));</div><div class="line"><a name="l00481"></a><span class="lineno">  481</span>&#160;            }</div><div class="line"><a name="l00482"></a><span class="lineno">  482</span>&#160;</div><div class="line"><a name="l00483"></a><span class="lineno">  483</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00484"></a><span class="lineno">  484</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00492"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#a2e19c4d0b48d7f73e0aa273d85435370">  492</a></span>&#160;<span class="comment"></span>            <a class="code" href="classnc_1_1_nd_array.html">NdArray&lt;double&gt;</a> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a2e19c4d0b48d7f73e0aa273d85435370">rotate</a>(<span class="keyword">const</span> <a class="code" href="classnc_1_1_nd_array.html">NdArray&lt;double&gt;</a>&amp; inVector)<span class="keyword"> const</span></div><div class="line"><a name="l00493"></a><span class="lineno">  493</span>&#160;<span class="keyword">            </span>{</div><div class="line"><a name="l00494"></a><span class="lineno">  494</span>&#160;                <span class="keywordflow">if</span> (inVector.<a class="code" href="classnc_1_1_nd_array.html#a6871de7968fa26f32d9c43167cd66131">size</a>() != 3)</div><div class="line"><a name="l00495"></a><span class="lineno">  495</span>&#160;                {</div><div class="line"><a name="l00496"></a><span class="lineno">  496</span>&#160;                    <a class="code" href="_error_8hpp.html#af2aff1172060367b9c5398fa097fa8fd">THROW_INVALID_ARGUMENT_ERROR</a>(<span class="stringliteral">&quot;input inVector must be a cartesion vector of length = 3.&quot;</span>);</div><div class="line"><a name="l00497"></a><span class="lineno">  497</span>&#160;                }</div><div class="line"><a name="l00498"></a><span class="lineno">  498</span>&#160;</div><div class="line"><a name="l00499"></a><span class="lineno">  499</span>&#160;                <span class="keywordflow">return</span> *<span class="keyword">this</span> * inVector;</div><div class="line"><a name="l00500"></a><span class="lineno">  500</span>&#160;            }</div><div class="line"><a name="l00501"></a><span class="lineno">  501</span>&#160;</div><div class="line"><a name="l00502"></a><span class="lineno">  502</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00503"></a><span class="lineno">  503</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00511"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#a3e0593a2ad77fad88afdfb8a34b9c036">  511</a></span>&#160;<span class="comment"></span>            <a class="code" href="classnc_1_1_vec3.html">Vec3</a> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a3e0593a2ad77fad88afdfb8a34b9c036">rotate</a>(<span class="keyword">const</span> <a class="code" href="classnc_1_1_vec3.html">Vec3</a>&amp; inVec3) <span class="keyword">const</span> noexcept</div><div class="line"><a name="l00512"></a><span class="lineno">  512</span>&#160;            {</div><div class="line"><a name="l00513"></a><span class="lineno">  513</span>&#160;                <span class="keywordflow">return</span> *<span class="keyword">this</span> * inVec3;</div><div class="line"><a name="l00514"></a><span class="lineno">  514</span>&#160;            }</div><div class="line"><a name="l00515"></a><span class="lineno">  515</span>&#160;</div><div class="line"><a name="l00516"></a><span class="lineno">  516</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00517"></a><span class="lineno">  517</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00523"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#a075b6f1befef247f5d638c91e1a451fd">  523</a></span>&#160;<span class="comment"></span>            <span class="keywordtype">double</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a075b6f1befef247f5d638c91e1a451fd">s</a>() const noexcept</div><div class="line"><a name="l00524"></a><span class="lineno">  524</span>&#160;            {</div><div class="line"><a name="l00525"></a><span class="lineno">  525</span>&#160;                <span class="keywordflow">return</span> components_[3];</div><div class="line"><a name="l00526"></a><span class="lineno">  526</span>&#160;            }</div><div class="line"><a name="l00527"></a><span class="lineno">  527</span>&#160;</div><div class="line"><a name="l00528"></a><span class="lineno">  528</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00529"></a><span class="lineno">  529</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00538"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#a7a39f199e4d1ad773b93c69e66ae0415">  538</a></span>&#160;<span class="comment"></span>            <span class="keyword">static</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a7a39f199e4d1ad773b93c69e66ae0415">slerp</a>(<span class="keyword">const</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a>&amp; inQuat1, <span class="keyword">const</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a>&amp; inQuat2, <span class="keywordtype">double</span> inPercent)</div><div class="line"><a name="l00539"></a><span class="lineno">  539</span>&#160;            {</div><div class="line"><a name="l00540"></a><span class="lineno">  540</span>&#160;                <span class="keywordflow">if</span> (inPercent &lt; 0 || inPercent &gt; 1)</div><div class="line"><a name="l00541"></a><span class="lineno">  541</span>&#160;                {</div><div class="line"><a name="l00542"></a><span class="lineno">  542</span>&#160;                    <a class="code" href="_error_8hpp.html#af2aff1172060367b9c5398fa097fa8fd">THROW_INVALID_ARGUMENT_ERROR</a>(<span class="stringliteral">&quot;input percent must be of the range [0, 1]&quot;</span>);</div><div class="line"><a name="l00543"></a><span class="lineno">  543</span>&#160;                }</div><div class="line"><a name="l00544"></a><span class="lineno">  544</span>&#160;</div><div class="line"><a name="l00545"></a><span class="lineno">  545</span>&#160;                <span class="keywordflow">if</span> (inPercent == 0)</div><div class="line"><a name="l00546"></a><span class="lineno">  546</span>&#160;                {</div><div class="line"><a name="l00547"></a><span class="lineno">  547</span>&#160;                    <span class="keywordflow">return</span> inQuat1;</div><div class="line"><a name="l00548"></a><span class="lineno">  548</span>&#160;                }</div><div class="line"><a name="l00549"></a><span class="lineno">  549</span>&#160;                <span class="keywordflow">else</span> <span class="keywordflow">if</span> (inPercent == 1)</div><div class="line"><a name="l00550"></a><span class="lineno">  550</span>&#160;                {</div><div class="line"><a name="l00551"></a><span class="lineno">  551</span>&#160;                    <span class="keywordflow">return</span> inQuat2;</div><div class="line"><a name="l00552"></a><span class="lineno">  552</span>&#160;                }</div><div class="line"><a name="l00553"></a><span class="lineno">  553</span>&#160;</div><div class="line"><a name="l00554"></a><span class="lineno">  554</span>&#160;                <span class="keywordtype">double</span> dotProduct = dot&lt;double&gt;(inQuat1.<a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a4a11c1c0daf982f9367e4541e5735e71">toNdArray</a>(), inQuat2.<a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a4a11c1c0daf982f9367e4541e5735e71">toNdArray</a>()).item();</div><div class="line"><a name="l00555"></a><span class="lineno">  555</span>&#160;</div><div class="line"><a name="l00556"></a><span class="lineno">  556</span>&#160;                <span class="comment">// If the dot product is negative, the quaternions</span></div><div class="line"><a name="l00557"></a><span class="lineno">  557</span>&#160;                <span class="comment">// have opposite handed-ness and slerp won&#39;t take</span></div><div class="line"><a name="l00558"></a><span class="lineno">  558</span>&#160;                <span class="comment">// the shorter path. Fix by reversing one quaternion.</span></div><div class="line"><a name="l00559"></a><span class="lineno">  559</span>&#160;                <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a> quat1Copy(inQuat1);</div><div class="line"><a name="l00560"></a><span class="lineno">  560</span>&#160;                <span class="keywordflow">if</span> (dotProduct &lt; 0.0)</div><div class="line"><a name="l00561"></a><span class="lineno">  561</span>&#160;                {</div><div class="line"><a name="l00562"></a><span class="lineno">  562</span>&#160;                    quat1Copy *= -1;</div><div class="line"><a name="l00563"></a><span class="lineno">  563</span>&#160;                    dotProduct *= -1;</div><div class="line"><a name="l00564"></a><span class="lineno">  564</span>&#160;                }</div><div class="line"><a name="l00565"></a><span class="lineno">  565</span>&#160;</div><div class="line"><a name="l00566"></a><span class="lineno">  566</span>&#160;                <span class="keyword">const</span> <span class="keywordtype">double</span> DOT_THRESHOLD = 0.9995;</div><div class="line"><a name="l00567"></a><span class="lineno">  567</span>&#160;                <span class="keywordflow">if</span> (dotProduct &gt; DOT_THRESHOLD) {</div><div class="line"><a name="l00568"></a><span class="lineno">  568</span>&#160;                    <span class="comment">// If the inputs are too close for comfort, linearly interpolate</span></div><div class="line"><a name="l00569"></a><span class="lineno">  569</span>&#160;                    <span class="comment">// and normalize the result.</span></div><div class="line"><a name="l00570"></a><span class="lineno">  570</span>&#160;                    <span class="keywordflow">return</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a314478702a3da52f2be3f422057d8732">nlerp</a>(inQuat1, inQuat2, inPercent);</div><div class="line"><a name="l00571"></a><span class="lineno">  571</span>&#160;                }</div><div class="line"><a name="l00572"></a><span class="lineno">  572</span>&#160;</div><div class="line"><a name="l00573"></a><span class="lineno">  573</span>&#160;                dotProduct = <a class="code" href="namespacenc.html#a6f71d75583176a599a64647109170a08">clip</a>(dotProduct, -1.0, 1.0);   <span class="comment">// Robustness: Stay within domain of acos()</span></div><div class="line"><a name="l00574"></a><span class="lineno">  574</span>&#160;                <span class="keyword">const</span> <span class="keywordtype">double</span> theta0 = std::acos(dotProduct);        <span class="comment">// angle between input vectors</span></div><div class="line"><a name="l00575"></a><span class="lineno">  575</span>&#160;                <span class="keyword">const</span> <span class="keywordtype">double</span> theta = theta0 * inPercent;            <span class="comment">// angle between v0 and result</span></div><div class="line"><a name="l00576"></a><span class="lineno">  576</span>&#160;</div><div class="line"><a name="l00577"></a><span class="lineno">  577</span>&#160;                <span class="keyword">const</span> <span class="keywordtype">double</span> s0 = <a class="code" href="namespacenc.html#affd0f5b31b2bd1b9cea9ab54e25dfab2">std::cos</a>(theta) - dotProduct * <a class="code" href="namespacenc.html#a0d66dc207eb871bba26bff4838992fef">std::sin</a>(theta) / <a class="code" href="namespacenc.html#a0d66dc207eb871bba26bff4838992fef">std::sin</a>(theta0);  <span class="comment">// == sin(theta_0 - theta) / sin(theta_0)</span></div><div class="line"><a name="l00578"></a><span class="lineno">  578</span>&#160;                <span class="keyword">const</span> <span class="keywordtype">double</span> s1 = <a class="code" href="namespacenc.html#a0d66dc207eb871bba26bff4838992fef">std::sin</a>(theta) / <a class="code" href="namespacenc.html#a0d66dc207eb871bba26bff4838992fef">std::sin</a>(theta0);</div><div class="line"><a name="l00579"></a><span class="lineno">  579</span>&#160;</div><div class="line"><a name="l00580"></a><span class="lineno">  580</span>&#160;                <a class="code" href="classnc_1_1_nd_array.html">NdArray&lt;double&gt;</a> interpQuat = (inQuat1.<a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a4a11c1c0daf982f9367e4541e5735e71">toNdArray</a>() * s0) + (inQuat2.<a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a4a11c1c0daf982f9367e4541e5735e71">toNdArray</a>() * s1);</div><div class="line"><a name="l00581"></a><span class="lineno">  581</span>&#160;                <span class="keywordflow">return</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#ae4b67d060aa58aa6d22813d6ab851ec8">Quaternion</a>(interpQuat);</div><div class="line"><a name="l00582"></a><span class="lineno">  582</span>&#160;            }</div><div class="line"><a name="l00583"></a><span class="lineno">  583</span>&#160;</div><div class="line"><a name="l00584"></a><span class="lineno">  584</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00585"></a><span class="lineno">  585</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00593"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#a687155cd6469c095941b94a738119da9">  593</a></span>&#160;<span class="comment"></span>            <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a687155cd6469c095941b94a738119da9">slerp</a>(<span class="keyword">const</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a>&amp; inQuat2, <span class="keywordtype">double</span> inPercent)<span class="keyword"> const</span></div><div class="line"><a name="l00594"></a><span class="lineno">  594</span>&#160;<span class="keyword">            </span>{</div><div class="line"><a name="l00595"></a><span class="lineno">  595</span>&#160;                <span class="keywordflow">return</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a7a39f199e4d1ad773b93c69e66ae0415">slerp</a>(*<span class="keyword">this</span>, inQuat2, inPercent);</div><div class="line"><a name="l00596"></a><span class="lineno">  596</span>&#160;            }</div><div class="line"><a name="l00597"></a><span class="lineno">  597</span>&#160;</div><div class="line"><a name="l00598"></a><span class="lineno">  598</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00599"></a><span class="lineno">  599</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00605"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#ad03a97f148be61e687944af11fe45c99">  605</a></span>&#160;<span class="comment"></span>            std::string <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#ad03a97f148be61e687944af11fe45c99">str</a>() const noexcept</div><div class="line"><a name="l00606"></a><span class="lineno">  606</span>&#160;            {</div><div class="line"><a name="l00607"></a><span class="lineno">  607</span>&#160;                std::string output = <span class="stringliteral">&quot;[&quot;</span> + <a class="code" href="namespacenc_1_1utils.html#a2e3a14fbbce38b0f8710ea0d92ee2ffc">utils::num2str</a>(<a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a5a661b367dff916e8bdb5e28ac608ecd">i</a>()) + <span class="stringliteral">&quot;, &quot;</span> + <a class="code" href="namespacenc_1_1utils.html#a2e3a14fbbce38b0f8710ea0d92ee2ffc">utils::num2str</a>(<a class="code" href="classnc_1_1rotations_1_1_quaternion.html#acb62c703a1f96333bf76ad0735cb8b97">j</a>()) +</div><div class="line"><a name="l00608"></a><span class="lineno">  608</span>&#160;                    <span class="stringliteral">&quot;, &quot;</span> + <a class="code" href="namespacenc_1_1utils.html#a2e3a14fbbce38b0f8710ea0d92ee2ffc">utils::num2str</a>(<a class="code" href="classnc_1_1rotations_1_1_quaternion.html#aa2eee61d3a428a558f28d1bb6cc6a048">k</a>()) + <span class="stringliteral">&quot;, &quot;</span> + <a class="code" href="namespacenc_1_1utils.html#a2e3a14fbbce38b0f8710ea0d92ee2ffc">utils::num2str</a>(<a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a075b6f1befef247f5d638c91e1a451fd">s</a>()) + <span class="stringliteral">&quot;]\n&quot;</span>;</div><div class="line"><a name="l00609"></a><span class="lineno">  609</span>&#160;</div><div class="line"><a name="l00610"></a><span class="lineno">  610</span>&#160;                <span class="keywordflow">return</span> output;</div><div class="line"><a name="l00611"></a><span class="lineno">  611</span>&#160;            }</div><div class="line"><a name="l00612"></a><span class="lineno">  612</span>&#160;</div><div class="line"><a name="l00613"></a><span class="lineno">  613</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00614"></a><span class="lineno">  614</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00620"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#a32d6c7cf2ff12d988e169fd936aaf397">  620</a></span>&#160;<span class="comment"></span>            <a class="code" href="classnc_1_1_nd_array.html">NdArray&lt;double&gt;</a> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a32d6c7cf2ff12d988e169fd936aaf397">toDCM</a>() const noexcept</div><div class="line"><a name="l00621"></a><span class="lineno">  621</span>&#160;            {</div><div class="line"><a name="l00622"></a><span class="lineno">  622</span>&#160;                <a class="code" href="classnc_1_1_nd_array.html">NdArray&lt;double&gt;</a> dcm(3);</div><div class="line"><a name="l00623"></a><span class="lineno">  623</span>&#160;</div><div class="line"><a name="l00624"></a><span class="lineno">  624</span>&#160;                <span class="keyword">const</span> <span class="keywordtype">double</span> q0 = <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a5a661b367dff916e8bdb5e28ac608ecd">i</a>();</div><div class="line"><a name="l00625"></a><span class="lineno">  625</span>&#160;                <span class="keyword">const</span> <span class="keywordtype">double</span> q1 = <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#acb62c703a1f96333bf76ad0735cb8b97">j</a>();</div><div class="line"><a name="l00626"></a><span class="lineno">  626</span>&#160;                <span class="keyword">const</span> <span class="keywordtype">double</span> q2 = <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#aa2eee61d3a428a558f28d1bb6cc6a048">k</a>();</div><div class="line"><a name="l00627"></a><span class="lineno">  627</span>&#160;                <span class="keyword">const</span> <span class="keywordtype">double</span> q3 = <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a075b6f1befef247f5d638c91e1a451fd">s</a>();</div><div class="line"><a name="l00628"></a><span class="lineno">  628</span>&#160;</div><div class="line"><a name="l00629"></a><span class="lineno">  629</span>&#160;                <span class="keyword">const</span> <span class="keywordtype">double</span> q0sqr = <a class="code" href="namespacenc_1_1utils.html#ae792e10a24b7e5b8291a6c31a28a4512">utils::sqr</a>(q0);</div><div class="line"><a name="l00630"></a><span class="lineno">  630</span>&#160;                <span class="keyword">const</span> <span class="keywordtype">double</span> q1sqr = <a class="code" href="namespacenc_1_1utils.html#ae792e10a24b7e5b8291a6c31a28a4512">utils::sqr</a>(q1);</div><div class="line"><a name="l00631"></a><span class="lineno">  631</span>&#160;                <span class="keyword">const</span> <span class="keywordtype">double</span> q2sqr = <a class="code" href="namespacenc_1_1utils.html#ae792e10a24b7e5b8291a6c31a28a4512">utils::sqr</a>(q2);</div><div class="line"><a name="l00632"></a><span class="lineno">  632</span>&#160;                <span class="keyword">const</span> <span class="keywordtype">double</span> q3sqr = <a class="code" href="namespacenc_1_1utils.html#ae792e10a24b7e5b8291a6c31a28a4512">utils::sqr</a>(q3);</div><div class="line"><a name="l00633"></a><span class="lineno">  633</span>&#160;</div><div class="line"><a name="l00634"></a><span class="lineno">  634</span>&#160;                dcm(0, 0) = q3sqr + q0sqr - q1sqr - q2sqr;</div><div class="line"><a name="l00635"></a><span class="lineno">  635</span>&#160;                dcm(0, 1) = 2 * (q0 * q1 - q3 * q2);</div><div class="line"><a name="l00636"></a><span class="lineno">  636</span>&#160;                dcm(0, 2) = 2 * (q0 * q2 + q3 * q1);</div><div class="line"><a name="l00637"></a><span class="lineno">  637</span>&#160;                dcm(1, 0) = 2 * (q0 * q1 + q3 * q2);</div><div class="line"><a name="l00638"></a><span class="lineno">  638</span>&#160;                dcm(1, 1) = q3sqr + q1sqr - q0sqr - q2sqr;</div><div class="line"><a name="l00639"></a><span class="lineno">  639</span>&#160;                dcm(1, 2) = 2 * (q1 * q2 - q3 * q0);</div><div class="line"><a name="l00640"></a><span class="lineno">  640</span>&#160;                dcm(2, 0) = 2 * (q0 * q2 - q3 * q1);</div><div class="line"><a name="l00641"></a><span class="lineno">  641</span>&#160;                dcm(2, 1) = 2 * (q1 * q2 + q3 * q0);</div><div class="line"><a name="l00642"></a><span class="lineno">  642</span>&#160;                dcm(2, 2) = q3sqr + q2sqr - q0sqr - q1sqr;</div><div class="line"><a name="l00643"></a><span class="lineno">  643</span>&#160;</div><div class="line"><a name="l00644"></a><span class="lineno">  644</span>&#160;                <span class="keywordflow">return</span> dcm;</div><div class="line"><a name="l00645"></a><span class="lineno">  645</span>&#160;            }</div><div class="line"><a name="l00646"></a><span class="lineno">  646</span>&#160;</div><div class="line"><a name="l00647"></a><span class="lineno">  647</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00648"></a><span class="lineno">  648</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00654"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#a4a11c1c0daf982f9367e4541e5735e71">  654</a></span>&#160;<span class="comment"></span>            <a class="code" href="classnc_1_1_nd_array.html">NdArray&lt;double&gt;</a> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a4a11c1c0daf982f9367e4541e5735e71">toNdArray</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00655"></a><span class="lineno">  655</span>&#160;<span class="keyword">            </span>{</div><div class="line"><a name="l00656"></a><span class="lineno">  656</span>&#160;                <span class="keywordflow">return</span> <a class="code" href="classnc_1_1_nd_array.html">NdArray&lt;double&gt;</a>(components_);</div><div class="line"><a name="l00657"></a><span class="lineno">  657</span>&#160;            }</div><div class="line"><a name="l00658"></a><span class="lineno">  658</span>&#160;</div><div class="line"><a name="l00659"></a><span class="lineno">  659</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00660"></a><span class="lineno">  660</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00668"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#a11697b4e29f40fd56b791fa2bc956eb5">  668</a></span>&#160;<span class="comment"></span>            <span class="keyword">static</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a11697b4e29f40fd56b791fa2bc956eb5">xRotation</a>(<span class="keywordtype">double</span> inAngle)</div><div class="line"><a name="l00669"></a><span class="lineno">  669</span>&#160;            {</div><div class="line"><a name="l00670"></a><span class="lineno">  670</span>&#160;                <a class="code" href="classnc_1_1_vec3.html">Vec3</a> eulerAxis = { 1.0, 0.0, 0.0 };</div><div class="line"><a name="l00671"></a><span class="lineno">  671</span>&#160;                <span class="keywordflow">return</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#ae4b67d060aa58aa6d22813d6ab851ec8">Quaternion</a>(eulerAxis, inAngle);</div><div class="line"><a name="l00672"></a><span class="lineno">  672</span>&#160;            }</div><div class="line"><a name="l00673"></a><span class="lineno">  673</span>&#160;</div><div class="line"><a name="l00674"></a><span class="lineno">  674</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00675"></a><span class="lineno">  675</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00680"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#a5b5cef534a39badf5d3079ee642e675c">  680</a></span>&#160;<span class="comment"></span>            <span class="keywordtype">double</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a5b5cef534a39badf5d3079ee642e675c">yaw</a>() const noexcept</div><div class="line"><a name="l00681"></a><span class="lineno">  681</span>&#160;            {</div><div class="line"><a name="l00682"></a><span class="lineno">  682</span>&#160;                <span class="keywordflow">return</span> std::atan2(2 * (<a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a075b6f1befef247f5d638c91e1a451fd">s</a>() * <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#aa2eee61d3a428a558f28d1bb6cc6a048">k</a>() + <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a5a661b367dff916e8bdb5e28ac608ecd">i</a>() * <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#acb62c703a1f96333bf76ad0735cb8b97">j</a>()), </div><div class="line"><a name="l00683"></a><span class="lineno">  683</span>&#160;                    1 - 2 * (<a class="code" href="namespacenc_1_1utils.html#ae792e10a24b7e5b8291a6c31a28a4512">utils::sqr</a>(<a class="code" href="classnc_1_1rotations_1_1_quaternion.html#acb62c703a1f96333bf76ad0735cb8b97">j</a>()) + <a class="code" href="namespacenc_1_1utils.html#ae792e10a24b7e5b8291a6c31a28a4512">utils::sqr</a>(<a class="code" href="classnc_1_1rotations_1_1_quaternion.html#aa2eee61d3a428a558f28d1bb6cc6a048">k</a>())));</div><div class="line"><a name="l00684"></a><span class="lineno">  684</span>&#160;            }</div><div class="line"><a name="l00685"></a><span class="lineno">  685</span>&#160;</div><div class="line"><a name="l00686"></a><span class="lineno">  686</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00687"></a><span class="lineno">  687</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00695"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#aeeaf2e45baa526aa7c31fc03f66ca109">  695</a></span>&#160;<span class="comment"></span>            <span class="keyword">static</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#aeeaf2e45baa526aa7c31fc03f66ca109">yRotation</a>(<span class="keywordtype">double</span> inAngle)</div><div class="line"><a name="l00696"></a><span class="lineno">  696</span>&#160;            {</div><div class="line"><a name="l00697"></a><span class="lineno">  697</span>&#160;                <a class="code" href="classnc_1_1_vec3.html">Vec3</a> eulerAxis = { 0.0, 1.0, 0.0 };</div><div class="line"><a name="l00698"></a><span class="lineno">  698</span>&#160;                <span class="keywordflow">return</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#ae4b67d060aa58aa6d22813d6ab851ec8">Quaternion</a>(eulerAxis, inAngle);</div><div class="line"><a name="l00699"></a><span class="lineno">  699</span>&#160;            }</div><div class="line"><a name="l00700"></a><span class="lineno">  700</span>&#160;</div><div class="line"><a name="l00701"></a><span class="lineno">  701</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00702"></a><span class="lineno">  702</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00710"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#a02ffc6360355ca7f4d125a70b8930315">  710</a></span>&#160;<span class="comment"></span>            <span class="keyword">static</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a02ffc6360355ca7f4d125a70b8930315">zRotation</a>(<span class="keywordtype">double</span> inAngle)</div><div class="line"><a name="l00711"></a><span class="lineno">  711</span>&#160;            {</div><div class="line"><a name="l00712"></a><span class="lineno">  712</span>&#160;                <a class="code" href="classnc_1_1_vec3.html">Vec3</a> eulerAxis = { 0.0, 0.0, 1.0 };</div><div class="line"><a name="l00713"></a><span class="lineno">  713</span>&#160;                <span class="keywordflow">return</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#ae4b67d060aa58aa6d22813d6ab851ec8">Quaternion</a>(eulerAxis, inAngle);</div><div class="line"><a name="l00714"></a><span class="lineno">  714</span>&#160;            }</div><div class="line"><a name="l00715"></a><span class="lineno">  715</span>&#160;</div><div class="line"><a name="l00716"></a><span class="lineno">  716</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00717"></a><span class="lineno">  717</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00725"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#a82f40acb2292256faffab2b88aa38208">  725</a></span>&#160;<span class="comment"></span>            <span class="keywordtype">bool</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a82f40acb2292256faffab2b88aa38208">operator==</a>(<span class="keyword">const</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a>&amp; inRhs) <span class="keyword">const</span> noexcept</div><div class="line"><a name="l00726"></a><span class="lineno">  726</span>&#160;            {</div><div class="line"><a name="l00727"></a><span class="lineno">  727</span>&#160;                <span class="keywordflow">return</span> <a class="code" href="namespacenc_1_1stl__algorithms.html#a3de9f1dd54e8db8997e7928322e098f4">stl_algorithms::equal</a>(components_.begin(), components_.end(),</div><div class="line"><a name="l00728"></a><span class="lineno">  728</span>&#160;                    inRhs.components_.begin(),</div><div class="line"><a name="l00729"></a><span class="lineno">  729</span>&#160;                    <span class="keyword">static_cast&lt;</span><span class="keywordtype">bool</span> (*)(<span class="keywordtype">double</span>, <span class="keywordtype">double</span>)<span class="keyword">&gt;</span>(&amp;utils::essentiallyEqual&lt;double&gt;));</div><div class="line"><a name="l00730"></a><span class="lineno">  730</span>&#160;            }</div><div class="line"><a name="l00731"></a><span class="lineno">  731</span>&#160;</div><div class="line"><a name="l00732"></a><span class="lineno">  732</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00733"></a><span class="lineno">  733</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00741"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#adcf57fd29d62e19f5c764750262ff7c3">  741</a></span>&#160;<span class="comment"></span>            <span class="keywordtype">bool</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#adcf57fd29d62e19f5c764750262ff7c3">operator!=</a>(<span class="keyword">const</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a>&amp; inRhs) <span class="keyword">const</span> noexcept</div><div class="line"><a name="l00742"></a><span class="lineno">  742</span>&#160;            {</div><div class="line"><a name="l00743"></a><span class="lineno">  743</span>&#160;                <span class="keywordflow">return</span> !(*<span class="keyword">this</span> == inRhs);</div><div class="line"><a name="l00744"></a><span class="lineno">  744</span>&#160;            }</div><div class="line"><a name="l00745"></a><span class="lineno">  745</span>&#160;</div><div class="line"><a name="l00746"></a><span class="lineno">  746</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00747"></a><span class="lineno">  747</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00755"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#a53c84fdd06a1f980c7c74a185d568156">  755</a></span>&#160;<span class="comment"></span>            <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a53c84fdd06a1f980c7c74a185d568156">operator+</a>(<span class="keyword">const</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a>&amp; inRhs) <span class="keyword">const</span> noexcept</div><div class="line"><a name="l00756"></a><span class="lineno">  756</span>&#160;            {</div><div class="line"><a name="l00757"></a><span class="lineno">  757</span>&#160;                <span class="keywordflow">return</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#ae4b67d060aa58aa6d22813d6ab851ec8">Quaternion</a>(*<span class="keyword">this</span>) += inRhs;</div><div class="line"><a name="l00758"></a><span class="lineno">  758</span>&#160;            }</div><div class="line"><a name="l00759"></a><span class="lineno">  759</span>&#160;</div><div class="line"><a name="l00760"></a><span class="lineno">  760</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00761"></a><span class="lineno">  761</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00769"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#af2b75597d538e55cfdd1215c35c9c6fe">  769</a></span>&#160;<span class="comment"></span>            <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a>&amp; <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#af2b75597d538e55cfdd1215c35c9c6fe">operator+=</a>(<span class="keyword">const</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a>&amp; inRhs) noexcept</div><div class="line"><a name="l00770"></a><span class="lineno">  770</span>&#160;            {</div><div class="line"><a name="l00771"></a><span class="lineno">  771</span>&#160;                <a class="code" href="namespacenc_1_1stl__algorithms.html#a616d5dabd547326285946d0014361ab4">stl_algorithms::transform</a>(components_.begin(), components_.end(),</div><div class="line"><a name="l00772"></a><span class="lineno">  772</span>&#160;                    inRhs.components_.begin(), components_.begin(), std::plus&lt;double&gt;());</div><div class="line"><a name="l00773"></a><span class="lineno">  773</span>&#160;</div><div class="line"><a name="l00774"></a><span class="lineno">  774</span>&#160;                normalize();</div><div class="line"><a name="l00775"></a><span class="lineno">  775</span>&#160;</div><div class="line"><a name="l00776"></a><span class="lineno">  776</span>&#160;                <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00777"></a><span class="lineno">  777</span>&#160;            }</div><div class="line"><a name="l00778"></a><span class="lineno">  778</span>&#160;</div><div class="line"><a name="l00779"></a><span class="lineno">  779</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00780"></a><span class="lineno">  780</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00786"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#a43fe6603ffbaaadf9348910e17e99519">  786</a></span>&#160;<span class="comment"></span>            <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a43fe6603ffbaaadf9348910e17e99519">operator-</a>() const noexcept</div><div class="line"><a name="l00787"></a><span class="lineno">  787</span>&#160;            {</div><div class="line"><a name="l00788"></a><span class="lineno">  788</span>&#160;                <span class="keywordflow">return</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#ae4b67d060aa58aa6d22813d6ab851ec8">Quaternion</a>(*<span class="keyword">this</span>) *= -1.0;</div><div class="line"><a name="l00789"></a><span class="lineno">  789</span>&#160;            }</div><div class="line"><a name="l00790"></a><span class="lineno">  790</span>&#160;</div><div class="line"><a name="l00791"></a><span class="lineno">  791</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00792"></a><span class="lineno">  792</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00800"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#ad6eb2370d77e01a944c4b32a48966e76">  800</a></span>&#160;<span class="comment"></span>            <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#ad6eb2370d77e01a944c4b32a48966e76">operator-</a>(<span class="keyword">const</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a>&amp; inRhs) <span class="keyword">const</span> noexcept</div><div class="line"><a name="l00801"></a><span class="lineno">  801</span>&#160;            {</div><div class="line"><a name="l00802"></a><span class="lineno">  802</span>&#160;                <span class="keywordflow">return</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#ae4b67d060aa58aa6d22813d6ab851ec8">Quaternion</a>(*<span class="keyword">this</span>) -= inRhs;</div><div class="line"><a name="l00803"></a><span class="lineno">  803</span>&#160;            }</div><div class="line"><a name="l00804"></a><span class="lineno">  804</span>&#160;</div><div class="line"><a name="l00805"></a><span class="lineno">  805</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00806"></a><span class="lineno">  806</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00814"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#a60f1f33144c887cde1338fd80183638f">  814</a></span>&#160;<span class="comment"></span>            <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a>&amp; <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a60f1f33144c887cde1338fd80183638f">operator-=</a>(<span class="keyword">const</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a>&amp; inRhs) noexcept</div><div class="line"><a name="l00815"></a><span class="lineno">  815</span>&#160;            {</div><div class="line"><a name="l00816"></a><span class="lineno">  816</span>&#160;                <a class="code" href="namespacenc_1_1stl__algorithms.html#a616d5dabd547326285946d0014361ab4">stl_algorithms::transform</a>(components_.begin(), components_.end(),</div><div class="line"><a name="l00817"></a><span class="lineno">  817</span>&#160;                    inRhs.components_.begin(), components_.begin(), std::minus&lt;double&gt;());</div><div class="line"><a name="l00818"></a><span class="lineno">  818</span>&#160;</div><div class="line"><a name="l00819"></a><span class="lineno">  819</span>&#160;                normalize();</div><div class="line"><a name="l00820"></a><span class="lineno">  820</span>&#160;</div><div class="line"><a name="l00821"></a><span class="lineno">  821</span>&#160;                <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00822"></a><span class="lineno">  822</span>&#160;            }</div><div class="line"><a name="l00823"></a><span class="lineno">  823</span>&#160;</div><div class="line"><a name="l00824"></a><span class="lineno">  824</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00825"></a><span class="lineno">  825</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00833"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#adad6ca92266f6090930addc585900805">  833</a></span>&#160;<span class="comment"></span>            <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#adad6ca92266f6090930addc585900805">operator*</a>(<span class="keyword">const</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a>&amp; inRhs) <span class="keyword">const</span> noexcept</div><div class="line"><a name="l00834"></a><span class="lineno">  834</span>&#160;            {</div><div class="line"><a name="l00835"></a><span class="lineno">  835</span>&#160;                <span class="keywordflow">return</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#ae4b67d060aa58aa6d22813d6ab851ec8">Quaternion</a>(*<span class="keyword">this</span>) *= inRhs;</div><div class="line"><a name="l00836"></a><span class="lineno">  836</span>&#160;            }</div><div class="line"><a name="l00837"></a><span class="lineno">  837</span>&#160;</div><div class="line"><a name="l00838"></a><span class="lineno">  838</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00839"></a><span class="lineno">  839</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00848"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#ad63920fa01f5bd4949c0fbb3ff7c7137">  848</a></span>&#160;<span class="comment"></span>            <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#ad63920fa01f5bd4949c0fbb3ff7c7137">operator*</a>(<span class="keywordtype">double</span> inScalar) <span class="keyword">const</span> noexcept</div><div class="line"><a name="l00849"></a><span class="lineno">  849</span>&#160;            {</div><div class="line"><a name="l00850"></a><span class="lineno">  850</span>&#160;                <span class="keywordflow">return</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#ae4b67d060aa58aa6d22813d6ab851ec8">Quaternion</a>(*<span class="keyword">this</span>) *= inScalar;</div><div class="line"><a name="l00851"></a><span class="lineno">  851</span>&#160;            }</div><div class="line"><a name="l00852"></a><span class="lineno">  852</span>&#160;</div><div class="line"><a name="l00853"></a><span class="lineno">  853</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00854"></a><span class="lineno">  854</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00862"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#a10fd2d44927d59f19e37c45586072d14">  862</a></span>&#160;<span class="comment"></span>            <a class="code" href="classnc_1_1_nd_array.html">NdArray&lt;double&gt;</a> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a10fd2d44927d59f19e37c45586072d14">operator*</a>(<span class="keyword">const</span> <a class="code" href="classnc_1_1_nd_array.html">NdArray&lt;double&gt;</a>&amp; inVec)<span class="keyword"> const</span></div><div class="line"><a name="l00863"></a><span class="lineno">  863</span>&#160;<span class="keyword">            </span>{</div><div class="line"><a name="l00864"></a><span class="lineno">  864</span>&#160;                <span class="keywordflow">if</span> (inVec.<a class="code" href="classnc_1_1_nd_array.html#a6871de7968fa26f32d9c43167cd66131">size</a>() != 3)</div><div class="line"><a name="l00865"></a><span class="lineno">  865</span>&#160;                {</div><div class="line"><a name="l00866"></a><span class="lineno">  866</span>&#160;                    <a class="code" href="_error_8hpp.html#af2aff1172060367b9c5398fa097fa8fd">THROW_INVALID_ARGUMENT_ERROR</a>(<span class="stringliteral">&quot;input vector must be a cartesion vector of length = 3.&quot;</span>);</div><div class="line"><a name="l00867"></a><span class="lineno">  867</span>&#160;                }</div><div class="line"><a name="l00868"></a><span class="lineno">  868</span>&#160;</div><div class="line"><a name="l00869"></a><span class="lineno">  869</span>&#160;                <span class="keyword">auto</span> p = <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#ae4b67d060aa58aa6d22813d6ab851ec8">Quaternion</a>(inVec[0], inVec[1], inVec[2], 0.0);</div><div class="line"><a name="l00870"></a><span class="lineno">  870</span>&#160;                <span class="keyword">auto</span> pPrime = *<span class="keyword">this</span> * p * this-&gt;<a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a9b0634474b2ff27f9443ba256ea00ab1">inverse</a>();</div><div class="line"><a name="l00871"></a><span class="lineno">  871</span>&#160;</div><div class="line"><a name="l00872"></a><span class="lineno">  872</span>&#160;                <a class="code" href="classnc_1_1_nd_array.html">NdArray&lt;double&gt;</a> rotatedVec = { pPrime.i(), pPrime.j(), pPrime.k() };</div><div class="line"><a name="l00873"></a><span class="lineno">  873</span>&#160;                rotatedVec *= inVec.<a class="code" href="classnc_1_1_nd_array.html#a9a8b5063ec64c9d0d9afdce057db77ea">norm</a>().<a class="code" href="classnc_1_1_nd_array.html#a4f5da296a91f836fa7627fad29828117">item</a>();</div><div class="line"><a name="l00874"></a><span class="lineno">  874</span>&#160;                <span class="keywordflow">return</span> rotatedVec;</div><div class="line"><a name="l00875"></a><span class="lineno">  875</span>&#160;            }</div><div class="line"><a name="l00876"></a><span class="lineno">  876</span>&#160;</div><div class="line"><a name="l00877"></a><span class="lineno">  877</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00878"></a><span class="lineno">  878</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00886"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#a7a76d280d13d7c7542c6f815ed5dbd22">  886</a></span>&#160;<span class="comment"></span>            <a class="code" href="classnc_1_1_vec3.html">Vec3</a> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a7a76d280d13d7c7542c6f815ed5dbd22">operator*</a>(<span class="keyword">const</span> <a class="code" href="classnc_1_1_vec3.html">Vec3</a>&amp; inVec3) <span class="keyword">const</span> noexcept</div><div class="line"><a name="l00887"></a><span class="lineno">  887</span>&#160;            {</div><div class="line"><a name="l00888"></a><span class="lineno">  888</span>&#160;                <span class="keywordflow">return</span> *<span class="keyword">this</span> * inVec3.<a class="code" href="classnc_1_1_vec3.html#a6b598b3ea3e950081df48026b5132459">toNdArray</a>();</div><div class="line"><a name="l00889"></a><span class="lineno">  889</span>&#160;            }</div><div class="line"><a name="l00890"></a><span class="lineno">  890</span>&#160;</div><div class="line"><a name="l00891"></a><span class="lineno">  891</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00892"></a><span class="lineno">  892</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00900"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#aaaa8a1bd7130e7ce6a819284584a84c5">  900</a></span>&#160;<span class="comment"></span>            <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a>&amp; <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#aaaa8a1bd7130e7ce6a819284584a84c5">operator*=</a>(<span class="keyword">const</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a>&amp; inRhs) noexcept</div><div class="line"><a name="l00901"></a><span class="lineno">  901</span>&#160;            {</div><div class="line"><a name="l00902"></a><span class="lineno">  902</span>&#160;                <span class="keywordtype">double</span> q0 = inRhs.<a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a075b6f1befef247f5d638c91e1a451fd">s</a>() * <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a5a661b367dff916e8bdb5e28ac608ecd">i</a>();</div><div class="line"><a name="l00903"></a><span class="lineno">  903</span>&#160;                q0 += inRhs.i() * <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a075b6f1befef247f5d638c91e1a451fd">s</a>();</div><div class="line"><a name="l00904"></a><span class="lineno">  904</span>&#160;                q0 -= inRhs.j() * <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#aa2eee61d3a428a558f28d1bb6cc6a048">k</a>();</div><div class="line"><a name="l00905"></a><span class="lineno">  905</span>&#160;                q0 += inRhs.k() * <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#acb62c703a1f96333bf76ad0735cb8b97">j</a>();</div><div class="line"><a name="l00906"></a><span class="lineno">  906</span>&#160;</div><div class="line"><a name="l00907"></a><span class="lineno">  907</span>&#160;                <span class="keywordtype">double</span> q1 = inRhs.s() * <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#acb62c703a1f96333bf76ad0735cb8b97">j</a>();</div><div class="line"><a name="l00908"></a><span class="lineno">  908</span>&#160;                q1 += inRhs.i() * <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#aa2eee61d3a428a558f28d1bb6cc6a048">k</a>();</div><div class="line"><a name="l00909"></a><span class="lineno">  909</span>&#160;                q1 += inRhs.j() * <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a075b6f1befef247f5d638c91e1a451fd">s</a>();</div><div class="line"><a name="l00910"></a><span class="lineno">  910</span>&#160;                q1 -= inRhs.k() * <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a5a661b367dff916e8bdb5e28ac608ecd">i</a>();</div><div class="line"><a name="l00911"></a><span class="lineno">  911</span>&#160;</div><div class="line"><a name="l00912"></a><span class="lineno">  912</span>&#160;                <span class="keywordtype">double</span> q2 = inRhs.s() * <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#aa2eee61d3a428a558f28d1bb6cc6a048">k</a>();</div><div class="line"><a name="l00913"></a><span class="lineno">  913</span>&#160;                q2 -= inRhs.i() * <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#acb62c703a1f96333bf76ad0735cb8b97">j</a>();</div><div class="line"><a name="l00914"></a><span class="lineno">  914</span>&#160;                q2 += inRhs.j() * <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a5a661b367dff916e8bdb5e28ac608ecd">i</a>();</div><div class="line"><a name="l00915"></a><span class="lineno">  915</span>&#160;                q2 += inRhs.k() * <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a075b6f1befef247f5d638c91e1a451fd">s</a>();</div><div class="line"><a name="l00916"></a><span class="lineno">  916</span>&#160;</div><div class="line"><a name="l00917"></a><span class="lineno">  917</span>&#160;                <span class="keywordtype">double</span> q3 = inRhs.s() * <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a075b6f1befef247f5d638c91e1a451fd">s</a>();</div><div class="line"><a name="l00918"></a><span class="lineno">  918</span>&#160;                q3 -= inRhs.i() * <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a5a661b367dff916e8bdb5e28ac608ecd">i</a>();</div><div class="line"><a name="l00919"></a><span class="lineno">  919</span>&#160;                q3 -= inRhs.j() * <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#acb62c703a1f96333bf76ad0735cb8b97">j</a>();</div><div class="line"><a name="l00920"></a><span class="lineno">  920</span>&#160;                q3 -= inRhs.k() * <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#aa2eee61d3a428a558f28d1bb6cc6a048">k</a>();</div><div class="line"><a name="l00921"></a><span class="lineno">  921</span>&#160;</div><div class="line"><a name="l00922"></a><span class="lineno">  922</span>&#160;                components_[0] = q0;</div><div class="line"><a name="l00923"></a><span class="lineno">  923</span>&#160;                components_[1] = q1;</div><div class="line"><a name="l00924"></a><span class="lineno">  924</span>&#160;                components_[2] = q2;</div><div class="line"><a name="l00925"></a><span class="lineno">  925</span>&#160;                components_[3] = q3;</div><div class="line"><a name="l00926"></a><span class="lineno">  926</span>&#160;</div><div class="line"><a name="l00927"></a><span class="lineno">  927</span>&#160;                normalize();</div><div class="line"><a name="l00928"></a><span class="lineno">  928</span>&#160;</div><div class="line"><a name="l00929"></a><span class="lineno">  929</span>&#160;                <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00930"></a><span class="lineno">  930</span>&#160;            }</div><div class="line"><a name="l00931"></a><span class="lineno">  931</span>&#160;</div><div class="line"><a name="l00932"></a><span class="lineno">  932</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00933"></a><span class="lineno">  933</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00942"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#a17636913a3a1e810a81a558dc986fd54">  942</a></span>&#160;<span class="comment"></span>            <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a>&amp; <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a17636913a3a1e810a81a558dc986fd54">operator*=</a>(<span class="keywordtype">double</span> inScalar) noexcept</div><div class="line"><a name="l00943"></a><span class="lineno">  943</span>&#160;            {</div><div class="line"><a name="l00944"></a><span class="lineno">  944</span>&#160;                <a class="code" href="namespacenc_1_1stl__algorithms.html#a734698435eabdbc5bdf93b195d7fb6a7">stl_algorithms::for_each</a>(components_.begin(), components_.end(),</div><div class="line"><a name="l00945"></a><span class="lineno">  945</span>&#160;                    [&amp;inScalar](<span class="keywordtype">double</span>&amp; component)</div><div class="line"><a name="l00946"></a><span class="lineno">  946</span>&#160;                    {</div><div class="line"><a name="l00947"></a><span class="lineno">  947</span>&#160;                        component *= inScalar; </div><div class="line"><a name="l00948"></a><span class="lineno">  948</span>&#160;                    });</div><div class="line"><a name="l00949"></a><span class="lineno">  949</span>&#160;</div><div class="line"><a name="l00950"></a><span class="lineno">  950</span>&#160;                normalize();</div><div class="line"><a name="l00951"></a><span class="lineno">  951</span>&#160;</div><div class="line"><a name="l00952"></a><span class="lineno">  952</span>&#160;                <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00953"></a><span class="lineno">  953</span>&#160;            }</div><div class="line"><a name="l00954"></a><span class="lineno">  954</span>&#160;</div><div class="line"><a name="l00955"></a><span class="lineno">  955</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00956"></a><span class="lineno">  956</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00964"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#ab054e067fc333a48582e291f95120866">  964</a></span>&#160;<span class="comment"></span>            <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#ab054e067fc333a48582e291f95120866">operator/</a>(<span class="keyword">const</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a>&amp; inRhs) <span class="keyword">const</span> noexcept</div><div class="line"><a name="l00965"></a><span class="lineno">  965</span>&#160;            {</div><div class="line"><a name="l00966"></a><span class="lineno">  966</span>&#160;                <span class="keywordflow">return</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#ae4b67d060aa58aa6d22813d6ab851ec8">Quaternion</a>(*<span class="keyword">this</span>) /= inRhs;</div><div class="line"><a name="l00967"></a><span class="lineno">  967</span>&#160;            }</div><div class="line"><a name="l00968"></a><span class="lineno">  968</span>&#160;</div><div class="line"><a name="l00969"></a><span class="lineno">  969</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00970"></a><span class="lineno">  970</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00978"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#a859df40774ccff755560604b930c934d">  978</a></span>&#160;<span class="comment"></span>            <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a>&amp; <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a859df40774ccff755560604b930c934d">operator/=</a>(<span class="keyword">const</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a>&amp; inRhs) noexcept</div><div class="line"><a name="l00979"></a><span class="lineno">  979</span>&#160;            {</div><div class="line"><a name="l00980"></a><span class="lineno">  980</span>&#160;                <span class="keywordflow">return</span> *<span class="keyword">this</span> *= inRhs.<a class="code" href="classnc_1_1rotations_1_1_quaternion.html#ade406544e8360506bb77102d17b14e61">conjugate</a>();</div><div class="line"><a name="l00981"></a><span class="lineno">  981</span>&#160;            }</div><div class="line"><a name="l00982"></a><span class="lineno">  982</span>&#160;</div><div class="line"><a name="l00983"></a><span class="lineno">  983</span>&#160;            <span class="comment">//============================================================================</span></div><div class="line"><a name="l00984"></a><span class="lineno">  984</span>&#160;            <span class="comment">// Method Description:</span></div><div class="line"><a name="l00992"></a><span class="lineno"><a class="line" href="classnc_1_1rotations_1_1_quaternion.html#a6b7cbc0cd1087f742488b555aef19c10">  992</a></span>&#160;<span class="comment"></span>            <span class="keyword">friend</span> std::ostream&amp; <a class="code" href="classnc_1_1rotations_1_1_quaternion.html#a6b7cbc0cd1087f742488b555aef19c10">operator&lt;&lt;</a>(std::ostream&amp; inOStream, <span class="keyword">const</span> <a class="code" href="classnc_1_1rotations_1_1_quaternion.html">Quaternion</a>&amp; inQuat) noexcept</div><div class="line"><a name="l00993"></a><span class="lineno">  993</span>&#160;            {</div><div class="line"><a name="l00994"></a><span class="lineno">  994</span>&#160;                inOStream &lt;&lt; inQuat.str();</div><div class="line"><a name="l00995"></a><span class="lineno">  995</span>&#160;                <span class="keywordflow">return</span> inOStream;</div><div class="line"><a name="l00996"></a><span class="lineno">  996</span>&#160;            }</div><div class="line"><a name="l00997"></a><span class="lineno">  997</span>&#160;        };</div><div class="line"><a name="l00998"></a><span class="lineno">  998</span>&#160;    }</div><div class="line"><a name="l00999"></a><span class="lineno">  999</span>&#160;}</div><div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_ab054e067fc333a48582e291f95120866"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#ab054e067fc333a48582e291f95120866">nc::rotations::Quaternion::operator/</a></div><div class="ttdeci">Quaternion operator/(const Quaternion &amp;inRhs) const noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:964</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_aeeaf2e45baa526aa7c31fc03f66ca109"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#aeeaf2e45baa526aa7c31fc03f66ca109">nc::rotations::Quaternion::yRotation</a></div><div class="ttdeci">static Quaternion yRotation(double inAngle)</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:695</div></div>
<div class="ttc" id="classnc_1_1_nd_array_html_aae29c9fbae3e92ce432703ffd7722d8b"><div class="ttname"><a href="classnc_1_1_nd_array.html#aae29c9fbae3e92ce432703ffd7722d8b">nc::NdArray::transpose</a></div><div class="ttdeci">NdArray&lt; dtype &gt; transpose() const noexcept</div><div class="ttdef"><b>Definition:</b> NdArray.hpp:3842</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_a8c498c295071b8b787902044bf87d34d"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#a8c498c295071b8b787902044bf87d34d">nc::rotations::Quaternion::Quaternion</a></div><div class="ttdeci">Quaternion(double roll, double pitch, double yaw) noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:189</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_a2e19c4d0b48d7f73e0aa273d85435370"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#a2e19c4d0b48d7f73e0aa273d85435370">nc::rotations::Quaternion::rotate</a></div><div class="ttdeci">NdArray&lt; double &gt; rotate(const NdArray&lt; double &gt; &amp;inVector) const</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:492</div></div>
<div class="ttc" id="namespacenc_html_acb264011e6e6cd182cc47f67018a6b3c"><div class="ttname"><a href="namespacenc.html#acb264011e6e6cd182cc47f67018a6b3c">nc::sqrt</a></div><div class="ttdeci">double sqrt(dtype inValue) noexcept</div><div class="ttdef"><b>Definition:</b> sqrt.hpp:50</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_a82f40acb2292256faffab2b88aa38208"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#a82f40acb2292256faffab2b88aa38208">nc::rotations::Quaternion::operator==</a></div><div class="ttdeci">bool operator==(const Quaternion &amp;inRhs) const noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:725</div></div>
<div class="ttc" id="classnc_1_1_shape_html_a6f89f699dea6eb89eef19e00c92b223a"><div class="ttname"><a href="classnc_1_1_shape.html#a6f89f699dea6eb89eef19e00c92b223a">nc::Shape::rows</a></div><div class="ttdeci">uint32 rows</div><div class="ttdef"><b>Definition:</b> Core/Shape.hpp:45</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_ade406544e8360506bb77102d17b14e61"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#ade406544e8360506bb77102d17b14e61">nc::rotations::Quaternion::conjugate</a></div><div class="ttdeci">Quaternion conjugate() const noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:332</div></div>
<div class="ttc" id="_error_8hpp_html"><div class="ttname"><a href="_error_8hpp.html">Error.hpp</a></div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_ad6eb2370d77e01a944c4b32a48966e76"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#ad6eb2370d77e01a944c4b32a48966e76">nc::rotations::Quaternion::operator-</a></div><div class="ttdeci">Quaternion operator-(const Quaternion &amp;inRhs) const noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:800</div></div>
<div class="ttc" id="namespacenc_html"><div class="ttname"><a href="namespacenc.html">nc</a></div><div class="ttdef"><b>Definition:</b> Coordinate.hpp:45</div></div>
<div class="ttc" id="classnc_1_1_nd_array_html_a232a5e8c426b629dcda9f9d52e8ce905"><div class="ttname"><a href="classnc_1_1_nd_array.html#a232a5e8c426b629dcda9f9d52e8ce905">nc::NdArray::shape</a></div><div class="ttdeci">Shape shape() const noexcept</div><div class="ttdef"><b>Definition:</b> NdArray.hpp:3489</div></div>
<div class="ttc" id="essentially_equal_8hpp_html"><div class="ttname"><a href="essentially_equal_8hpp.html">essentiallyEqual.hpp</a></div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_a7a39f199e4d1ad773b93c69e66ae0415"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#a7a39f199e4d1ad773b93c69e66ae0415">nc::rotations::Quaternion::slerp</a></div><div class="ttdeci">static Quaternion slerp(const Quaternion &amp;inQuat1, const Quaternion &amp;inQuat2, double inPercent)</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:538</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_aa2eee61d3a428a558f28d1bb6cc6a048"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#aa2eee61d3a428a558f28d1bb6cc6a048">nc::rotations::Quaternion::k</a></div><div class="ttdeci">double k() const noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:393</div></div>
<div class="ttc" id="namespacenc_1_1utils_html_aa55788420fda79bd8a06debbaa29d24c"><div class="ttname"><a href="namespacenc_1_1utils.html#aa55788420fda79bd8a06debbaa29d24c">nc::utils::essentiallyEqual</a></div><div class="ttdeci">constexpr bool essentiallyEqual(dtype inValue1, dtype inValue2, dtype inEpsilon) noexcept</div><div class="ttdef"><b>Definition:</b> essentiallyEqual.hpp:50</div></div>
<div class="ttc" id="namespacenc_html_aacba4d66f94f6f53637e23c5d82e20d8"><div class="ttname"><a href="namespacenc.html#aacba4d66f94f6f53637e23c5d82e20d8">nc::uint32</a></div><div class="ttdeci">uint32_t uint32</div><div class="ttdef"><b>Definition:</b> Types.hpp:41</div></div>
<div class="ttc" id="classnc_1_1_slice_html"><div class="ttname"><a href="classnc_1_1_slice.html">nc::Slice</a></div><div class="ttdoc">A Class for slicing into NdArrays. </div><div class="ttdef"><b>Definition:</b> Slice.hpp:44</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_a81b7db9d5e593a61272e09ce7dcc1325"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#a81b7db9d5e593a61272e09ce7dcc1325">nc::rotations::Quaternion::Quaternion</a></div><div class="ttdeci">Quaternion(const NdArray&lt; double &gt; &amp;inAxis, double inAngle)</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:270</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_a5a661b367dff916e8bdb5e28ac608ecd"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#a5a661b367dff916e8bdb5e28ac608ecd">nc::rotations::Quaternion::i</a></div><div class="ttdeci">double i() const noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:344</div></div>
<div class="ttc" id="namespacenc_html_a0d66dc207eb871bba26bff4838992fef"><div class="ttname"><a href="namespacenc.html#a0d66dc207eb871bba26bff4838992fef">nc::sin</a></div><div class="ttdeci">double sin(dtype inValue) noexcept</div><div class="ttdef"><b>Definition:</b> sin.hpp:50</div></div>
<div class="ttc" id="namespacenc_1_1stl__algorithms_html_a616d5dabd547326285946d0014361ab4"><div class="ttname"><a href="namespacenc_1_1stl__algorithms.html#a616d5dabd547326285946d0014361ab4">nc::stl_algorithms::transform</a></div><div class="ttdeci">OutputIt transform(InputIt first, InputIt last, OutputIt destination, UnaryOperation unaryFunction)</div><div class="ttdef"><b>Definition:</b> StlAlgorithms.hpp:500</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_ad03a97f148be61e687944af11fe45c99"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#ad03a97f148be61e687944af11fe45c99">nc::rotations::Quaternion::str</a></div><div class="ttdeci">std::string str() const noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:605</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_a17636913a3a1e810a81a558dc986fd54"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#a17636913a3a1e810a81a558dc986fd54">nc::rotations::Quaternion::operator*=</a></div><div class="ttdeci">Quaternion &amp; operator*=(double inScalar) noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:942</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_adcf57fd29d62e19f5c764750262ff7c3"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#adcf57fd29d62e19f5c764750262ff7c3">nc::rotations::Quaternion::operator!=</a></div><div class="ttdeci">bool operator!=(const Quaternion &amp;inRhs) const noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:741</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_a7a76d280d13d7c7542c6f815ed5dbd22"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#a7a76d280d13d7c7542c6f815ed5dbd22">nc::rotations::Quaternion::operator*</a></div><div class="ttdeci">Vec3 operator*(const Vec3 &amp;inVec3) const noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:886</div></div>
<div class="ttc" id="classnc_1_1_vec3_html_a6356b462b11a156b923a7c79b9747c25"><div class="ttname"><a href="classnc_1_1_vec3.html#a6356b462b11a156b923a7c79b9747c25">nc::Vec3::normalize</a></div><div class="ttdeci">Vec3 normalize() const noexcept</div><div class="ttdef"><b>Definition:</b> Vec3.hpp:278</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_a314478702a3da52f2be3f422057d8732"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#a314478702a3da52f2be3f422057d8732">nc::rotations::Quaternion::nlerp</a></div><div class="ttdeci">static Quaternion nlerp(const Quaternion &amp;inQuat1, const Quaternion &amp;inQuat2, double inPercent)</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:408</div></div>
<div class="ttc" id="classnc_1_1_vec3_html_a7f71dd08d58a1327739de6041e3362bb"><div class="ttname"><a href="classnc_1_1_vec3.html#a7f71dd08d58a1327739de6041e3362bb">nc::Vec3::x</a></div><div class="ttdeci">double x</div><div class="ttdef"><b>Definition:</b> Vec3.hpp:54</div></div>
<div class="ttc" id="classnc_1_1_nd_array_html_a9a8b5063ec64c9d0d9afdce057db77ea"><div class="ttname"><a href="classnc_1_1_nd_array.html#a9a8b5063ec64c9d0d9afdce057db77ea">nc::NdArray::norm</a></div><div class="ttdeci">NdArray&lt; double &gt; norm(Axis inAxis=Axis::NONE) const noexcept</div><div class="ttdef"><b>Definition:</b> NdArray.hpp:2501</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_a44994f000aba8de9f11a169a62782ebd"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#a44994f000aba8de9f11a169a62782ebd">nc::rotations::Quaternion::print</a></div><div class="ttdeci">void print() const noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:466</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_a10fd2d44927d59f19e37c45586072d14"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#a10fd2d44927d59f19e37c45586072d14">nc::rotations::Quaternion::operator*</a></div><div class="ttdeci">NdArray&lt; double &gt; operator*(const NdArray&lt; double &gt; &amp;inVec) const</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:862</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_af2b75597d538e55cfdd1215c35c9c6fe"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#af2b75597d538e55cfdd1215c35c9c6fe">nc::rotations::Quaternion::operator+=</a></div><div class="ttdeci">Quaternion &amp; operator+=(const Quaternion &amp;inRhs) noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:769</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_abbacae2cb36d4f7e93e1cf130f8ca6b4"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#abbacae2cb36d4f7e93e1cf130f8ca6b4">nc::rotations::Quaternion::Quaternion</a></div><div class="ttdeci">Quaternion(const Vec3 &amp;inAxis, double inAngle) noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:249</div></div>
<div class="ttc" id="_nd_array_8hpp_html"><div class="ttname"><a href="_nd_array_8hpp.html">NdArray.hpp</a></div></div>
<div class="ttc" id="classnc_1_1_nd_array_html_ad482cf57eed985a1bf8e3dcc0a0d21e1"><div class="ttname"><a href="classnc_1_1_nd_array.html#ad482cf57eed985a1bf8e3dcc0a0d21e1">nc::NdArray::zeros</a></div><div class="ttdeci">NdArray&lt; dtype &gt; &amp; zeros()</div><div class="ttdef"><b>Definition:</b> NdArray.hpp:3883</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_a5b5cef534a39badf5d3079ee642e675c"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#a5b5cef534a39badf5d3079ee642e675c">nc::rotations::Quaternion::yaw</a></div><div class="ttdeci">double yaw() const noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:680</div></div>
<div class="ttc" id="dot_8hpp_html"><div class="ttname"><a href="dot_8hpp.html">dot.hpp</a></div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_a60f1f33144c887cde1338fd80183638f"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#a60f1f33144c887cde1338fd80183638f">nc::rotations::Quaternion::operator-=</a></div><div class="ttdeci">Quaternion &amp; operator-=(const Quaternion &amp;inRhs) noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:814</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html">nc::rotations::Quaternion</a></div><div class="ttdoc">Holds a unit quaternion. </div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:57</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_acb62c703a1f96333bf76ad0735cb8b97"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#acb62c703a1f96333bf76ad0735cb8b97">nc::rotations::Quaternion::j</a></div><div class="ttdeci">double j() const noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:381</div></div>
<div class="ttc" id="square_8hpp_html"><div class="ttname"><a href="square_8hpp.html">square.hpp</a></div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_ae4b67d060aa58aa6d22813d6ab851ec8"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#ae4b67d060aa58aa6d22813d6ab851ec8">nc::rotations::Quaternion::Quaternion</a></div><div class="ttdeci">Quaternion() noexcept=default</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_a1ed072758066ed454d9ba0452dc5a2d0"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#a1ed072758066ed454d9ba0452dc5a2d0">nc::rotations::Quaternion::angularVelocity</a></div><div class="ttdeci">NdArray&lt; double &gt; angularVelocity(const Quaternion &amp;inQuat2, double inTime) const noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:320</div></div>
<div class="ttc" id="argmax_8hpp_html"><div class="ttname"><a href="argmax_8hpp.html">argmax.hpp</a></div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_a9b0634474b2ff27f9443ba256ea00ab1"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#a9b0634474b2ff27f9443ba256ea00ab1">nc::rotations::Quaternion::inverse</a></div><div class="ttdeci">Quaternion inverse() const noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:368</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_a687155cd6469c095941b94a738119da9"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#a687155cd6469c095941b94a738119da9">nc::rotations::Quaternion::slerp</a></div><div class="ttdeci">Quaternion slerp(const Quaternion &amp;inQuat2, double inPercent) const</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:593</div></div>
<div class="ttc" id="classnc_1_1_vec3_html_a6b598b3ea3e950081df48026b5132459"><div class="ttname"><a href="classnc_1_1_vec3.html#a6b598b3ea3e950081df48026b5132459">nc::Vec3::toNdArray</a></div><div class="ttdeci">NdArray&lt; double &gt; toNdArray() const noexcept</div><div class="ttdef"><b>Definition:</b> Vec3.hpp:326</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_ae093d333b66b63eeef5704be4a374af2"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#ae093d333b66b63eeef5704be4a374af2">nc::rotations::Quaternion::identity</a></div><div class="ttdeci">static Quaternion identity() noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:356</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_addcc7fb7b4acd4201e7f5b90ef207f4d"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#addcc7fb7b4acd4201e7f5b90ef207f4d">nc::rotations::Quaternion::Quaternion</a></div><div class="ttdeci">Quaternion(const NdArray&lt; double &gt; &amp;inArray)</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:217</div></div>
<div class="ttc" id="classnc_1_1_vec3_html_a969dd1c195f4c78fc3a93292391e29c1"><div class="ttname"><a href="classnc_1_1_vec3.html#a969dd1c195f4c78fc3a93292391e29c1">nc::Vec3::y</a></div><div class="ttdeci">double y</div><div class="ttdef"><b>Definition:</b> Vec3.hpp:55</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_a859df40774ccff755560604b930c934d"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#a859df40774ccff755560604b930c934d">nc::rotations::Quaternion::operator/=</a></div><div class="ttdeci">Quaternion &amp; operator/=(const Quaternion &amp;inRhs) noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:978</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_a26f2a9303f0521ee36d92467ab45e3ab"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#a26f2a9303f0521ee36d92467ab45e3ab">nc::rotations::Quaternion::roll</a></div><div class="ttdeci">double roll() const noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:477</div></div>
<div class="ttc" id="namespacenc_html_a2185848c4b822d5636fad30c3eda6275"><div class="ttname"><a href="namespacenc.html#a2185848c4b822d5636fad30c3eda6275">nc::argmax</a></div><div class="ttdeci">NdArray&lt; uint32 &gt; argmax(const NdArray&lt; dtype &gt; &amp;inArray, Axis inAxis=Axis::NONE) noexcept</div><div class="ttdef"><b>Definition:</b> argmax.hpp:48</div></div>
<div class="ttc" id="_error_8hpp_html_af2aff1172060367b9c5398fa097fa8fd"><div class="ttname"><a href="_error_8hpp.html#af2aff1172060367b9c5398fa097fa8fd">THROW_INVALID_ARGUMENT_ERROR</a></div><div class="ttdeci">#define THROW_INVALID_ARGUMENT_ERROR(msg)</div><div class="ttdef"><b>Definition:</b> Error.hpp:38</div></div>
<div class="ttc" id="_stl_algorithms_8hpp_html"><div class="ttname"><a href="_stl_algorithms_8hpp.html">StlAlgorithms.hpp</a></div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_a601b444c8c8f820700844d7ab5f743ba"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#a601b444c8c8f820700844d7ab5f743ba">nc::rotations::Quaternion::pitch</a></div><div class="ttdeci">double pitch() const noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:457</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_ad63920fa01f5bd4949c0fbb3ff7c7137"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#ad63920fa01f5bd4949c0fbb3ff7c7137">nc::rotations::Quaternion::operator*</a></div><div class="ttdeci">Quaternion operator*(double inScalar) const noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:848</div></div>
<div class="ttc" id="hat_8hpp_html"><div class="ttname"><a href="hat_8hpp.html">hat.hpp</a></div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_a4a11c1c0daf982f9367e4541e5735e71"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#a4a11c1c0daf982f9367e4541e5735e71">nc::rotations::Quaternion::toNdArray</a></div><div class="ttdeci">NdArray&lt; double &gt; toNdArray() const</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:654</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_a6b7cbc0cd1087f742488b555aef19c10"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#a6b7cbc0cd1087f742488b555aef19c10">nc::rotations::Quaternion::operator&lt;&lt;</a></div><div class="ttdeci">friend std::ostream &amp; operator&lt;&lt;(std::ostream &amp;inOStream, const Quaternion &amp;inQuat) noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:992</div></div>
<div class="ttc" id="_types_8hpp_html"><div class="ttname"><a href="_types_8hpp.html">Types.hpp</a></div></div>
<div class="ttc" id="namespacenc_html_acd0cb71d7333dddc7cfa8a091768e94a"><div class="ttname"><a href="namespacenc.html#acd0cb71d7333dddc7cfa8a091768e94a">nc::norm</a></div><div class="ttdeci">NdArray&lt; double &gt; norm(const NdArray&lt; dtype &gt; &amp;inArray, Axis inAxis=Axis::NONE) noexcept</div><div class="ttdef"><b>Definition:</b> norm.hpp:47</div></div>
<div class="ttc" id="namespacenc_1_1stl__algorithms_html_a3de9f1dd54e8db8997e7928322e098f4"><div class="ttname"><a href="namespacenc_1_1stl__algorithms.html#a3de9f1dd54e8db8997e7928322e098f4">nc::stl_algorithms::equal</a></div><div class="ttdeci">bool equal(InputIt1 first1, InputIt1 last1, InputIt2 first2)</div><div class="ttdef"><b>Definition:</b> StlAlgorithms.hpp:131</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_aaaa8a1bd7130e7ce6a819284584a84c5"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#aaaa8a1bd7130e7ce6a819284584a84c5">nc::rotations::Quaternion::operator*=</a></div><div class="ttdeci">Quaternion &amp; operator*=(const Quaternion &amp;inRhs) noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:900</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_a53c84fdd06a1f980c7c74a185d568156"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#a53c84fdd06a1f980c7c74a185d568156">nc::rotations::Quaternion::operator+</a></div><div class="ttdeci">Quaternion operator+(const Quaternion &amp;inRhs) const noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:755</div></div>
<div class="ttc" id="classnc_1_1_shape_html"><div class="ttname"><a href="classnc_1_1_shape.html">nc::Shape</a></div><div class="ttdoc">A Shape Class for NdArrays. </div><div class="ttdef"><b>Definition:</b> Core/Shape.hpp:41</div></div>
<div class="ttc" id="classnc_1_1_vec3_html_a0896ee691f46ce0bd669b869fe6acb41"><div class="ttname"><a href="classnc_1_1_vec3.html#a0896ee691f46ce0bd669b869fe6acb41">nc::Vec3::z</a></div><div class="ttdeci">double z</div><div class="ttdef"><b>Definition:</b> Vec3.hpp:56</div></div>
<div class="ttc" id="sqr_8hpp_html"><div class="ttname"><a href="sqr_8hpp.html">sqr.hpp</a></div></div>
<div class="ttc" id="namespacenc_1_1utils_html_ae792e10a24b7e5b8291a6c31a28a4512"><div class="ttname"><a href="namespacenc_1_1utils.html#ae792e10a24b7e5b8291a6c31a28a4512">nc::utils::sqr</a></div><div class="ttdeci">constexpr dtype sqr(dtype inValue) noexcept</div><div class="ttdef"><b>Definition:</b> sqr.hpp:43</div></div>
<div class="ttc" id="classnc_1_1_nd_array_html_a13e5756a193d375c0b52e5929a41ca2f"><div class="ttname"><a href="classnc_1_1_nd_array.html#a13e5756a193d375c0b52e5929a41ca2f">nc::NdArray::dot</a></div><div class="ttdeci">NdArray&lt; dtype &gt; dot(const NdArray&lt; dtype &gt; &amp;inOtherArray) const</div><div class="ttdef"><b>Definition:</b> NdArray.hpp:1772</div></div>
<div class="ttc" id="namespacenc_1_1stl__algorithms_html_afc0a193758bfb62333c4ed53ada9537d"><div class="ttname"><a href="namespacenc_1_1stl__algorithms.html#afc0a193758bfb62333c4ed53ada9537d">nc::stl_algorithms::copy</a></div><div class="ttdeci">OutputIt copy(InputIt first, InputIt last, OutputIt destination)</div><div class="ttdef"><b>Definition:</b> StlAlgorithms.hpp:92</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_a11697b4e29f40fd56b791fa2bc956eb5"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#a11697b4e29f40fd56b791fa2bc956eb5">nc::rotations::Quaternion::xRotation</a></div><div class="ttdeci">static Quaternion xRotation(double inAngle)</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:668</div></div>
<div class="ttc" id="classnc_1_1_vec3_html"><div class="ttname"><a href="classnc_1_1_vec3.html">nc::Vec3</a></div><div class="ttdoc">Holds a 3D vector. </div><div class="ttdef"><b>Definition:</b> Vec3.hpp:50</div></div>
<div class="ttc" id="namespacenc_html_affd0f5b31b2bd1b9cea9ab54e25dfab2"><div class="ttname"><a href="namespacenc.html#affd0f5b31b2bd1b9cea9ab54e25dfab2">nc::cos</a></div><div class="ttdeci">double cos(dtype inValue) noexcept</div><div class="ttdef"><b>Definition:</b> cos.hpp:50</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_a02ffc6360355ca7f4d125a70b8930315"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#a02ffc6360355ca7f4d125a70b8930315">nc::rotations::Quaternion::zRotation</a></div><div class="ttdeci">static Quaternion zRotation(double inAngle)</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:710</div></div>
<div class="ttc" id="num2str_8hpp_html"><div class="ttname"><a href="num2str_8hpp.html">num2str.hpp</a></div></div>
<div class="ttc" id="classnc_1_1_nd_array_html_a6871de7968fa26f32d9c43167cd66131"><div class="ttname"><a href="classnc_1_1_nd_array.html#a6871de7968fa26f32d9c43167cd66131">nc::NdArray::size</a></div><div class="ttdeci">uint32 size() const noexcept</div><div class="ttdef"><b>Definition:</b> NdArray.hpp:3503</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_a43fe6603ffbaaadf9348910e17e99519"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#a43fe6603ffbaaadf9348910e17e99519">nc::rotations::Quaternion::operator-</a></div><div class="ttdeci">Quaternion operator-() const noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:786</div></div>
<div class="ttc" id="namespacenc_1_1stl__algorithms_html_a734698435eabdbc5bdf93b195d7fb6a7"><div class="ttname"><a href="namespacenc_1_1stl__algorithms.html#a734698435eabdbc5bdf93b195d7fb6a7">nc::stl_algorithms::for_each</a></div><div class="ttdeci">void for_each(InputIt first, InputIt last, UnaryFunction f)</div><div class="ttdef"><b>Definition:</b> StlAlgorithms.hpp:209</div></div>
<div class="ttc" id="_vec3_8hpp_html"><div class="ttname"><a href="_vec3_8hpp.html">Vec3.hpp</a></div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_a3ba2fb2c68554ec78a0957dc1fd7752d"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#a3ba2fb2c68554ec78a0957dc1fd7752d">nc::rotations::Quaternion::Quaternion</a></div><div class="ttdeci">Quaternion(double inI, double inJ, double inK, double inS) noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:203</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_ab7905c39ef162eb7667abcd3131430ea"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#ab7905c39ef162eb7667abcd3131430ea">nc::rotations::Quaternion::angularVelocity</a></div><div class="ttdeci">static NdArray&lt; double &gt; angularVelocity(const Quaternion &amp;inQuat1, const Quaternion &amp;inQuat2, double inTime) noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:285</div></div>
<div class="ttc" id="classnc_1_1_nd_array_html"><div class="ttname"><a href="classnc_1_1_nd_array.html">nc::NdArray&lt; double &gt;</a></div></div>
<div class="ttc" id="namespacenc_html_a6f71d75583176a599a64647109170a08"><div class="ttname"><a href="namespacenc.html#a6f71d75583176a599a64647109170a08">nc::clip</a></div><div class="ttdeci">dtype clip(dtype inValue, dtype inMinValue, dtype inMaxValue) noexcept</div><div class="ttdef"><b>Definition:</b> clip.hpp:50</div></div>
<div class="ttc" id="classnc_1_1_shape_html_aae1a3c997648aacaefb60d0e6d0bf10d"><div class="ttname"><a href="classnc_1_1_shape.html#aae1a3c997648aacaefb60d0e6d0bf10d">nc::Shape::cols</a></div><div class="ttdeci">uint32 cols</div><div class="ttdef"><b>Definition:</b> Core/Shape.hpp:46</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_a075b6f1befef247f5d638c91e1a451fd"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#a075b6f1befef247f5d638c91e1a451fd">nc::rotations::Quaternion::s</a></div><div class="ttdeci">double s() const noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:523</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_ab055510c1338490b957de867cecaf790"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#ab055510c1338490b957de867cecaf790">nc::rotations::Quaternion::nlerp</a></div><div class="ttdeci">Quaternion nlerp(const Quaternion &amp;inQuat2, double inPercent) const</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:446</div></div>
<div class="ttc" id="clip_8hpp_html"><div class="ttname"><a href="clip_8hpp.html">clip.hpp</a></div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_adad6ca92266f6090930addc585900805"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#adad6ca92266f6090930addc585900805">nc::rotations::Quaternion::operator*</a></div><div class="ttdeci">Quaternion operator*(const Quaternion &amp;inRhs) const noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:833</div></div>
<div class="ttc" id="namespacenc_1_1utils_html_a2e3a14fbbce38b0f8710ea0d92ee2ffc"><div class="ttname"><a href="namespacenc_1_1utils.html#a2e3a14fbbce38b0f8710ea0d92ee2ffc">nc::utils::num2str</a></div><div class="ttdeci">std::string num2str(dtype inNumber) noexcept</div><div class="ttdef"><b>Definition:</b> num2str.hpp:45</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_a32d6c7cf2ff12d988e169fd936aaf397"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#a32d6c7cf2ff12d988e169fd936aaf397">nc::rotations::Quaternion::toDCM</a></div><div class="ttdeci">NdArray&lt; double &gt; toDCM() const noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:620</div></div>
<div class="ttc" id="classnc_1_1_nd_array_html_a4f5da296a91f836fa7627fad29828117"><div class="ttname"><a href="classnc_1_1_nd_array.html#a4f5da296a91f836fa7627fad29828117">nc::NdArray::item</a></div><div class="ttdeci">dtype item() const</div><div class="ttdef"><b>Definition:</b> NdArray.hpp:2025</div></div>
<div class="ttc" id="classnc_1_1rotations_1_1_quaternion_html_a3e0593a2ad77fad88afdfb8a34b9c036"><div class="ttname"><a href="classnc_1_1rotations_1_1_quaternion.html#a3e0593a2ad77fad88afdfb8a34b9c036">nc::rotations::Quaternion::rotate</a></div><div class="ttdeci">Vec3 rotate(const Vec3 &amp;inVec3) const noexcept</div><div class="ttdef"><b>Definition:</b> Quaternion.hpp:511</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_34171bd951b13a53aa9f237277a18e40.html">NumCpp</a></li><li class="navelem"><a class="el" href="dir_cac3062759fc9841f0966ab05282555a.html">Rotations</a></li><li class="navelem"><a class="el" href="_quaternion_8hpp.html">Quaternion.hpp</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
  </ul>
</div>
</body>
</html>
